DataTrigger in WinRT?

DataTrigger is not currently supported in WinRT XAML. Addendum by Mike Brown The DataTrigger API has been replaced with the VisualStateManager a similar API to Data Triggers was provided by the Blend SDK for Silverlight. Since the Attached Behavior Pattern works in WinRT, it is possible to do the same.

WinRT/UWP Frame and Page caching: How to create new page instance on Navigate() and keep the page instance on GoBack()

Because there was no solution to this problem, I had to reimplement all paging relevant classes: Page, Frame, SuspensionManager, etc… The solution can be downloaded here: https://github.com/MyToolkit/MyToolkit/wiki/Paging-Overview Update: The page class now also provides the OnNavigatingFromAsync method to show for example an async popup and cancel navigation if required…

How do I get a Unique Identifier for a Device within Windows 10 Universal?

That is the complete solution for Windows Desktop: Add the Extension reference “Windows Desktop Extensions for the UWP” like Peter Torr – MSFT mentioned. Use this Code to get the HardwareId: using System; using Windows.Security.ExchangeActiveSyncProvisioning; using Windows.System.Profile; namespace Tobit.Software.Device { public sealed class DeviceInfo { private static DeviceInfo _Instance; public static DeviceInfo Instance { get … Read more

Correct way to get the CoreDispatcher in a Windows Store app

This is the preferred way: Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { // Your UI update code goes here! }); The advantage this has is that it gets the main CoreApplicationView and so is always available. More details here. There are two alternatives which you could use. First alternative Windows.ApplicationModel.Core.CoreApplication.GetCurrentView().CoreWindow.Dispatcher This gets the active view for the app, … Read more

Get Screen Resolution in Win10 UWP App

To improve the other answers even a bit more, the following code also takes care of scaling factors, e.g. for my 200% for my Windows display (correctly returns 3200×1800) and 300% of the Lumia 930 (1920×1080). var bounds = ApplicationView.GetForCurrentView().VisibleBounds; var scaleFactor = DisplayInformation.GetForCurrentView().RawPixelsPerViewPixel; var size = new Size(bounds.Width*scaleFactor, bounds.Height*scaleFactor); As stated in the other … Read more

How do I print WebView content in a Windows Store App?

Sure, here you go. First, you can resize the WebView to the actual content. Then, you scale the WebView back to the original size. It would require a script invoke and a ScaleTransform. Pretty simple, really. Like this: <Grid Background=”{StaticResource ApplicationPageBackgroundThemeBrush}”> <WebView x:Name=”MyWebView” Source=”http://www.stackoverflow.com” /> </Grid> void MyWebView_LoadCompleted(object sender, NavigationEventArgs e) { var _Original = … Read more

MessageDialog ShowAsync throws accessdenied exception on second dialog

Okay I found a quick solution, define a IAsyncOperation class varialble IAsyncOperation<IUICommand> asyncCommand = null; and set it to the ShowAsync method of MessageDialog asyncCommand = msg.ShowAsync(); In the command handler for retry/try again check if asyncCommand is not null and cancel the last operation if necessary if(asyncCommand != null) { asyncCommand.Cancel(); } Please let … Read more