Tag: windows phone 8

试图让Windows Phone 8 ListPicker工作

ListPicker函数,我可以单击它并出现一个全屏弹出窗口,但有一些选项可供选择。 我的xaml: 它背后的C#包括: String[] moduleNumber = { “AA1”, “AA2”, “AA3” }; 和 public MainPage() { InitializeComponent(); this.modulePicker.ItemsSource = moduleNumber; } 那么我需要做些什么来使moduleNumber中列出的字符串显示在ListPicker上? 如果您需要了解更多,请询问。

如何获取ListPicker的选定项目

我想确定当前在ListPicker中选择的项目的名称。 我不确定在SelectionChanged事件中要做什么来获取项目的名称。 XAML XAML.CS protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); themeList = new List(); themeList.Add(new Theme() { Name = “light” }); themeList.Add(new Theme() { Name = “dark” }); ThemeListPicker.ItemsSource = themeList; } private void ThemeListPicker_SelectionChanged(object sender, SelectionChangedEventArgs e) { //get the name of the current item in the listpicker? }

不知道如何使用ms-appx(wp8)引用项目中的文件

我想在我的项目中引用一个语法文件(Rootfile->文件夹名为grammar->名为NumbersGrammar的文件)我用这行代码但它告诉我0x80070002错误(系统找不到指定的文件): Uri Numbers = new Uri(“ms-appx:///Grammar/NumbersGrammar.grxml” ,UriKind.Absolute);

Windows Phone 8使用格式绑定到字符串资源

我的本地化资源字符串名为TextResource ,其值为: Text: {0} 。 其中{0}是String.Format的占位符。 我的用户控件有一个名为Count的DependecyProperty。 我想将Count绑定到文本框的文本,但也应用本地化的字符串。 这样文本块的内容就是Text: 5 (假设Count的值是5) 我设法弄清楚如何绑定本地化的字符串 或财产价值 但不是两个同时。 我怎么能在XAML中做到这一点? PS:一种选择是添加两个文本块而不是一个,但我不确定这是否是一个好习惯。

如何将图像路径保存到Live Tile的WP8 Local文件夹中

我正在更新我的Windows Phone应用程序以使用新的WP8文件存储API( LocalFolder )而不是WP7 API( IsolatedStorageFile )。 旧工作方法 以下是使用IsolatedStorageFile方法将Image成功保存到/ Shared / ShellContent文件夹的方法(在保存图像时注意/Shared/ShellContent/前缀,以及更新实时图块时的isostore:/Shared/ShellContent/前缀。 using (IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication()) { if (myIsolatedStorage.FileExists(“/Shared/ShellContent/LiveTileImagePath.jpg”)) { myIsolatedStorage.DeleteFile(“/Shared/ShellContent/LiveTileImagePath.jpg”); } IsolatedStorageFileStream copyFileStream = myIsolatedStorage.CreateFile(“/Shared/ShellContent/LiveTileImagePath.jpg”); wb.SaveJpeg(copyFileStream, wb.PixelWidth, wb.PixelHeight, 0, 100); copyFileStream.Close(); //UpdateTile ShellTile tile = ShellTile.ActiveTiles.First(); if (tile != null) { FlipTileData tileData = new FlipTileData() { Title = “title”, BackTitle = “backtitle”, […]

WP8应用中的付款

我目前正在制作Windows phone 8 silverlight应用程序。 在应用程序中,我们希望允许用户通过paypal或其他付款方式付款。 我还查看了开发中心的应用内付款,但没有设法看到带有变量值的付款。 任何有关如何使用的帮助或有关如何执行此操作的示例将不胜感激。 更新:根据Windows手机商店的政策,您不会使用PayPal,例如可以在应用程序付款中使用Windows Phone。

MediaComposition.RenderToFileAsync与许多静态图像崩溃

我有一个Windows Phone 8.1 Silverlight应用程序,使用Windows.Media.Editing.MediaComposition类将.gif文件呈现为.mp4。 某些文件将随机崩溃RenderToFileAsync方法。 您可以收到至少两个不同的错误消息,一个表明内存不足。 有没有人有任何关于变通方法的想法,或者一些关于这应该如何工作的内幕知识? 摄制: 在VS2013中创建新的c#WP8.1 Silverlight app空白项目 将Usings和OnNavigatedTo添加到MainPage.xaml.cs,如下所示。 运行512MB仿真器。 观察崩溃(大部分时间)。 摆弄i的价值,看它运作正常。 using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Navigation; using Microsoft.Phone.Controls; using Microsoft.Phone.Shell; using System.Windows.Media.Imaging; using System.IO; using Windows.Media.Editing; using System.Diagnostics; – protected async override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); SystemTray.ProgressIndicator = new ProgressIndicator(); SystemTray.ProgressIndicator.IsVisible […]

在Windows Phone 8.1上捕获转储

我正在开发一个Windows Phone 8.1应用程序。 我想添加一个function, 每当应用程序崩溃时,捕获内存转储并将其写入日志 。 我想知道当用户在手机上使用应用程序并且崩溃时,是否有任何方法可以记录崩溃转储。 我发现这个问题与我的相似,但适用于Windows 8 。 它说我们可以在App.xaml.cs中使用‘Application_UnhandledException’方法来获取转储。 但这种方法是否也支持Windows Phone 8.1,因为我没有在App.xaml.cs的自动生成内容中看到这一点(由Visual Studio生成并包含OnActivated,OnLaunched等function) UnhandledException事件处理程序是否在Windows Phone 8.1中执行此操作?

使用WPD将文件复制到Windows Phone C#

我想通过MTP将至少一个文件复制到Windows手机。 按照本教程,我能够连接到手机并将文件从手机复制到计算机: WPD:传输内容但是我无法以相反的方式复制文件(从计算机到手机)。 这是我的代码: IPortableDeviceContent content; this._device.Content(out content); IPortableDeviceValues values = GetRequiredPropertiesForContentType(fileName, parentObjectId); PortableDeviceApiLib.IStream tempStream; uint optimalTransferSizeBytes = 0; content.CreateObjectWithPropertiesAndData( values, out tempStream, ref optimalTransferSizeBytes, null); System.Runtime.InteropServices.ComTypes.IStream targetStream = (System.Runtime.InteropServices.ComTypes.IStream)tempStream; try { using (var sourceStream = new FileStream(fileName, FileMode.Open, FileAccess.Read)) { var buffer = new byte[optimalTransferSizeBytes]; int bytesRead; do { bytesRead = sourceStream.Read(buffer, 0, (int)optimalTransferSizeBytes); […]

如何将方形图像蒙版成圆角图像?

因为我想在我的Image控件中实现圆角面罩我设计了这样的控件 但是我正在接受控制 。 有人有想法用边框颜色填补角落吗?