windows-runtime

Metro App FileIO.WriteTextAsync Multiple Threads

扶醉桌前 提交于 2019-12-07 07:59:04
问题 I have a method which is called frequently from multiple threads. It involves writing to disk using await FileIO.WriteTextAsync . This works fine when it is called from a single thread, but once I start doing this in multiple threads, I get this error: The process cannot access the file because it is being used by another process. I know what the error means, but I'm not sure how to work around it. Normally, I would create a lock(object) statement, to ensure that the file is being accessed by

Where Is DrawingBrush In Windows Metro for XAML

坚强是说给别人听的谎言 提交于 2019-12-07 07:43:25
问题 Im writing a Windows Metro XAML based app in C#, and I want to draw grid lines with a brush on my custom grid control. In WPF I would create a DrawingBrush to do the job, but there seems to be no equivalent in Metro ??? Does anyone know if this feature exists under another name, or that you achieve the same result differently ? As an additional note, I do not want to draw lines etc directly on my grid (adding lines to my panel's children collection), It really needs to be done via the

WinRT - Display animated GIF in a control

喜夏-厌秋 提交于 2019-12-07 07:32:44
问题 I need to display an animated GIF in my metro app, but I can't find any control that allows it. (I tried Image , MediaElement and MediaPlayer from the Player Framework) Is it possible somehow to display an animated GIF? 回答1: While I haven't checked if it works and it might not work for you due to airspace issues - you could try hosting your gif in a WebView control. It might be a lot easier than the otherwise better solutions proposed by Norbert and Carl. 回答2: You can achieve this natively by

Unable to create a new mail with multiple recipients with mailto uri

巧了我就是萌 提交于 2019-12-07 06:29:31
问题 I am using creating a Windows 8.1 Store App in WinRT . I am unable to create a new mail with multiple recipients with the mailto uri by separating each email with either comma or semi colon, both gives me the same error. Invalid URI: The hostname could not be parsed. the mailto strings looks like this "mailto:username@mail.com,username2@mail.com" "mailto:username@mail.com,username2@mail.com," "mailto:username@mail.com, username2@mail.com" "mailto:username@mail.com;username2@mail.com" "mailto

Alarm code in Windows Phone 8.1

自闭症网瘾萝莉.ら 提交于 2019-12-07 06:06:26
I have code the app with future Reminder by Toast notification , i can remind every times by BackgroundTask But i want to reminder at one time in every day like : 4.00 PM every day I search and get info about Alarm and Reminder are out of Windows Phone 8.1 So have another way ? Sorry my bad English You can use a scheduled toast notification to fire a toast at a specific time. This doesn't require the app be running when the toast fires, only when the toast is scheduled. You will need to schedule individual toasts for each day as there is no automatic repetition. If the user is likely to run

Assigning an async result to a data binding property

天大地大妈咪最大 提交于 2019-12-07 05:43:56
问题 Below is a sample implementation that uses metro API and data binding (using MVVM) to populate list of folders in a drop down list. The View model‘s constructor uses SetFolders method (private async), which calls an awaitable method fileService.GetFoldersAsync() to get list of folders. The folders list is then gets assigned to the property called “FoldersList”. XAML uses this property to populate a drop down list using the data binding. I wonder is there a better way to set the FoldersList

Implementing State handling in windows 8 using MVVM Light

喜夏-厌秋 提交于 2019-12-07 05:40:57
问题 How i can implement state handling (running / resume / Terminate states ) using mvvm light. The major issue i a facing is with Navigation. I am totally uncontrolled with the navigation stack. How i can effectively manage this with MVVM Light. 回答1: You might be interested in the open source Okra App Framework that is freely available on CodePlex and NuGet (disclaimer: I am the lead developer on this project). This has been designed from the ground up for Windows 8 applications, in particular

Not able to connect to remote server from WinRT

和自甴很熟 提交于 2019-12-07 05:19:44
问题 I'm making an application which basically just needs to send a piece of XML to a server and return. I'm having trouble however getting this to work and getting very strange errors public bool Post(string data) { string server="http://my-lan-computer:9091/foo" bool success = false; HttpClient client = new HttpClient(); try { client.PostAsync(server, new StringContent(data, Encoding.UTF8, "text/xml")).Wait(); //error here success = true; } catch { } return success; } The server I'm posting to

What does version 255.255.255.255 for winmd files indicate?

核能气质少年 提交于 2019-12-07 04:38:23
问题 I noticed that most (all?) .winmd files have a version of 255.255.255.255 like: Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null Metro apps have a reference to such assemblies with this version number. Further the Windows.winmd itself references: mscorlib, Version=255.255.255.255, Culture=neutral, PublicKeyToken=b77a5c561934e089 However, an assembly with this version number does not exist, as far as I know. Does this version number have a special meaning? Is there any

Get localized friendly names for all winrt/metro apps installed from WPF application

六月ゝ 毕业季﹏ 提交于 2019-12-07 04:38:17
问题 My WPF application needs to list the localized names of all Metro/WinRT applications installed for the user. I created a repo to store a working sample for the code presented: https://github.com/luisrigoni/metro-apps-list 1) Using PackageManager.FindPackagesForUser() method var userSecurityId = WindowsIdentity.GetCurrent().User.Value; var packages = packageManager.FindPackagesForUser(userSecurityId); foreach (var package in packages) Debug.WriteLine(package.Id.Name); } // output: // Microsoft