Tag: windows phone 8.1

Windows phone 8.1本地数据库

我刚开始使用Windows手机“冒险”。 我想写一些应用程序,但我需要像Local DataBase这样的东西。 我该怎么用? 我找不到任何解决方案。 我尝试过本地数据库,但它在WP 8.1上不可用,我还找到了一个关于使用json的教程,但是这个教程也已经过时了,它不能用于8.1。 我只想写一个基于DataBase的小应用程序,其中有一个表可以读取和写入。 你可以给我发一个文章链接来解决我的问题吗? 提前致谢。

如何在Windows Phone Runtime中向Clipboard添加文本?

以前在Windows Phone 8中我们可以使用Clipboard来共享文本。 它在Windows 8中受支持, Clipboard.SetContent(dataPackage); 但我发现Windows Phone Runtime不支持它 。 难道不再可能,或者还有其他办法吗?

Windows Phone 8.1 Silverlight中的Toast通知参数

好的,所以我在8.1 SL项目中使用新的ToastNotificationManager而不是旧的ShellToast。 ShellToast在toast消息上有NavigationUri,这非常容易。 在新的祝酒词中,您必须根据本文自行指定启动参数。 但是看起来8.1 SL没有事件OnLaunched(LaunchActivatedEventArgs args)你应该在App.xaml.cs中监听参数: 第2步:处理应用程序的“OnLaunched”事件 当用户点击您的祝酒词或通过触摸选择它时,相关的应用程序将启动,并触发其OnLaunched事件。 注意如果您在Toast中未包含启动属性字符串,并且在选择Toast时您的应用程序已在运行,则不会触发OnLaunched事件。 此示例显示了OverLaunched事件的覆盖语法,您将在其中检索并处理通过Toast通知提供的启动字符串。 protected override void OnLaunched(LaunchActivatedEventArgs args) { string launchString = args.Arguments …. } 我的代码: // Using the ToastText02 toast template. ToastTemplateType toastTemplate = ToastTemplateType.ToastText02; // Retrieve the content part of the toast so we can change the text. XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(toastTemplate); //Find the text […]

JSON.NET DeserializeObject到对象列表

我正在尝试使用JSON.NET lib将对象反序列化为对象列表。 我的json文件是: [ { “id”: 1, “name”: “Poczta”, “description”: “Opis”, “latitude”: 52.25197, “longitude”: 20.896355, “accuracy”: 0, “type”: “”, “image”: null }, { “id”: 2, “name”: “WAT”, “description”: “Budynek główny – sztab.\r\nzażółć gęślą jaźń”, “latitude”: 52.2531213, “longitude”: 20.8995849, “accuracy”: 0, “type”: “Uczelnia”, “image”: null }, { “id”: 3, “name”: “Przychodnia”, “description”: “Opis”, “latitude”: 52.250808, “longitude”: […]

从HRESULT获取exception:在Windows Phone 8.1中发布到服务时为0x80072F0D

当我尝试使用Windows Phone 8.1中的HttpClient将数据发布到API时,我总是Exception from HRESULT: 0x80072F0D得到Exception from HRESULT: 0x80072F0Dexception。 在小提琴手,它工作正常。 try { var requestbody=”json data” HttpClient httpClient = new HttpClient(); HttpRequestMessage msg = new HttpRequestMessage(new HttpMethod(“POST”), new Uri(addressUri)); msg.Content = new HttpStringContent(requestbody); msg.Content.Headers.ContentType = new HttpMediaTypeHeaderValue(“application/json”); HttpResponseMessage response = await httpClient.SendRequestAsync(msg).AsTask(); } catch (Exception ex) { getting **Exception from HRESULT: 0x80072F0D** } 请告诉我出了什么问题? — FYI […]

将ListView中的SelectedItem绑定到Windows Phone 8.1中的ViewModel

我有以下代码: 使用以下DataTemplate: 在我的ViewModel中,我有以下内容: private ObservableCollection myList; public ObservableCollection MyList { get { return myList; } set { myList = value; RaisePropertyChanged(“MyList”); } } public IEnumerable SelectedItems { get { return MyList == null ? null : MyList.Where(e => e.IsSelected); } } 在我的模型中,我有其他人,我的IsSelected属性: private bool isSelected; public bool IsSelected { get { return isSelected; } set […]

Windows Phone 8.1 MediaComposition – 拼接video时音频太快

尝试将多个video连接在一起时遇到问题。 每当我合并2个或更多video时,音频以双倍速度播放,而video正常播放。 以下是代码。 我错过了什么吗? 我在测试时会得到相同的结果,但是克隆单个video或选择多个video。 我已经比较了这里的代码示例(我没有修剪)。 public static IAsyncOperation ConcatenateVideoRT([ReadOnlyArray]IStorageFile[] videoFiles, IStorageFolder outputFolder, string outputfileName) { return Task.Run(async () => { IStorageFile _OutputFile = await outputFolder.CreateFileAsync(outputfileName, CreationCollisionOption.GenerateUniqueName); MediaComposition _MediaComposition = new MediaComposition(); foreach (IStorageFile _VideoFile in videoFiles) { MediaClip _MediaClip = await MediaClip.CreateFromFileAsync(_VideoFile); _MediaComposition.Clips.Add(_MediaClip); _MediaComposition.Clips.Add(_MediaClip.Clone()); } TranscodeFailureReason _TranscodeFailureReason = await _MediaComposition.RenderToFileAsync(_OutputFile); if (_TranscodeFailureReason != TranscodeFailureReason.None) […]

从Windows Phone 8.1发送电子邮件

我想从windows phone 8.1 app.Email Compose任务中发送一封电子邮件。 我试过这个 EmailRecipient sendTo = new EmailRecipient() { Address = “abc@outlook.com” }; //generate mail object EmailMessage mail = new EmailMessage(); mail.Subject = “Feedback”; //add recipients to the mail object mail.To.Add(sendTo); //mail.Bcc.Add(sendTo); //mail.CC.Add(sendTo); //open the share contract with Mail only: await EmailManager.ShowComposeNewEmailAsync(mail); 这会在模拟器中出错: 不能分享 没有可与之分享的应用。

错误CS0012:类型’TaskAwaiter ‘在未引用的程序集中定义

当我尝试调试我的Windows Phone 8.1项目时,Locals窗口为空,Watch显示错误: this error CS0012: The type ‘TaskAwaiter’ is defined in an assembly that is not referenced. You must add a reference to assembly ‘System.Threading.Tasks, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’. 其他一切似乎工作得很好,没有与此相关的错误/警告,只有在调试时才会发生。 而且并非适用于所有项目。 我尝试过在Stack和MDSN上找到的一些修复,但是: 添加true没有改变任何东西; 调试>选项>常规>使用旧版VB和C#的内容显示为灰色。 还有什么我可以尝试的吗?

如何防止Windows(手机)8.1通用应用程序中的锁屏?

有谁知道,如何防止Windows(手机)8.1通用应用程序中的锁屏? 在Windows Phone 8中,我使用过: PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled; 有人有想法吗?