windows-store-apps

RunAsync - How do I await the completion of work on the UI thread?

≯℡__Kan透↙ 提交于 2019-12-17 18:19:54
问题 When awaiting Dispatcher.RunAsync the continuation occurs when the work is scheduled, not when the work has completed. How can I await the work completing? Edit My original question assumed the premature continuation was caused by the design of the API, so here's the real question. When awaiting Dispatcher.RunAsync using an asynchronous delegate, using await within the delegate's code, the continuation occurs when the await is encountered, not when the work has completed. How can I await the

Am I right to ignore the compiler warning for lacking await for this async call?

依然范特西╮ 提交于 2019-12-17 16:42:15
问题 I have the following method that is triggered when an exception occurs in a part of my Metro application void Model_ExceptionOccured(Exception ex) { var dlg = new Windows.UI.Popups.MessageDialog("An exception occured during verification: " + ex.Message, "Exception"); dlg.ShowAsync(); } The 'dlg.ShowAsync()'-call is asynchronous, but I don't care to wait for the result. The compiler generates a warning for it though: Because this call is not awaited, execution of the current method continues

Where is timer in a Windows store app?

时间秒杀一切 提交于 2019-12-17 16:33:42
问题 I could not find the Timer when developing a Windows Store App in c#. What is the alternative /new name/way of use of it? 回答1: Different timers for different needs. Roughly... DispatcherTimer - When you want work to be executed on the UI thread . ThreadPoolTimer - When you want work to be executed on a background thread . 回答2: DispatcherTimer is what you are looking for var timer = new DispatcherTimer(); timer.Tick += DispatcherTimerEventHandler; timer.Interval = new TimeSpan(0,0,0,1); timer

Could I know if my app is running on Windows RT with C#?

北城以北 提交于 2019-12-17 16:33:03
问题 I know that there is no way to get OS version in Windows Store app, please let me explain more. My app is a Windows Store app programming with C#. Some features of my app is depend on another desktop app (maybe it's not a good design). As I know, a third-party desktop app can not install on Windows RT, so I just want to know if my app is running on Windows RT and forbid some features of my app on Windows RT. I don't want to use GetNativeSystemInfo(), because it's a win32 API, and if I use

Windows 10 UWP - detect if the current internet connection is Wifi or Cellular?

人盡茶涼 提交于 2019-12-17 15:43:24
问题 In Windows 10 UWP app how do I detect if the current internet connection is Wifi or Cellular? 回答1: In UWP you can check network connectivity using the IsWlanConnectionProfile or IsWwanConnectionProfile properties. An example would be: var temp = Windows.Networking.Connectivity.NetworkInformation.GetInternetConnectionProfile(); if (temp.IsWlanConnectionProfile) { // its wireless }else if (temp.IsWwanConnectionProfile) { // its mobile } I hope this helps. 回答2: Other than just getting the

Is there a possibility to start another App or Program from a Windows 8 Store App (C#)

旧城冷巷雨未停 提交于 2019-12-17 14:56:18
问题 I want to start another App or Program from my Windows Store App. For example my App is showing emails, so if someone clicks on such an email Outlook should open. Is this possible in an "App-Sandbox"? 回答1: It is not possible to just launch an arbitrary application, but with custom protocol activation you can launch an app that handles that protocol and if it is not installed - the OS will ask the user to install it. It means that if you can define a custom protocol in your app - you can

XAML/C#: What event fires after reordering a gridview?

ε祈祈猫儿з 提交于 2019-12-17 10:44:13
问题 I am making my first Windows Store app in Visual Studios 2012. I have a gridview control that I have enabled to be reordered. I have code that I need to run when the list is reordered. I have tried the Drop event. It does not fire. I tried several other drag events, which also did not fire. It seems like this should be so simple... Thanks for your time! 回答1: You cannot reorder a GridView unless the ItemsSource is bound to an ObservableCollection and CanReorderItems , CanDragItems , and

Thread.Sleep replacement in .NET for Windows Store

江枫思渺然 提交于 2019-12-17 08:16:22
问题 Thread.Sleep doesn't seem to be supported in .NET for Windows Store apps. For example, this System.Threading.Thread.Sleep(1000); will compile when targeting any .NET Framework (2.0, 3.5, 4.0, 4.5), but not when targeting .NET for Windows Store apps (or in a portable class library which targets both 4.5 and store). System.Threading.Thread is still there, it just doesn't have the Sleep method. I need to delay something for a few seconds in my app, is there a suitable replacement? EDIT why the

Trying to debug Windows Store App from dump files

瘦欲@ 提交于 2019-12-17 07:39:19
问题 Let me start with my main questions, then below I will add some specifics and history. I have done research, but can't seem to fit the pieces together. Please ask for clarification before voting me down. My questions: Why would my Windows Store app start and run correctly locally on my Win 8.1 64 bit AND my Win 8.1 32 bit (Atom) tablet, but not start for other users? When I get the dump file from Windows Store certification failure, how can I get the debug symbols to work so I can see more of

Is it possible to update an existing Windows Phone 8 app to Windows Phone Store 8.1

寵の児 提交于 2019-12-17 06:53:54
问题 I've a Windows Phone 8.0 app on the Windows Phone Store, and I want to update my app to Windows Phone store API (and not Windows Phone Silverlight 8.1) to prepare Windows 8.1 version. Is it possible to update and migrate IsolatedStorage data from SL8 to Phone Store App? 回答1: TL;DR; - It preserves data on Isolated Storage when updating from WP8.0 to WP8.1 Runtime. Because the provided link to MSDN says only about Silverlight apps, and it's not clear (if I hadn't missed something) what would