WinRT apps and Regional settings. The correct way to format dates and numbers based on the user’s regional settings?

It’s been a while, but the question is not fully answered, so let me share my little research. Depechie is mostly right, but he provided only a link and wasn’t really sure. Yes, this unexpected change is intentional. We shouldn’t use CultureInfo anymore as it contains legacy codes and Microsoft want us to use Windows.Globalization … Read more

When to use a templated control over a UserControl?

TLDR A custom (templated) control allows an app to use the Template property to replace the control’s internal element tree. If you don’t need/want your control to have that re-templating feature, then use a UserControl as it’s easier. UserControl A UserControl is a lot easier to create with Visual Studio or Blend giving you a … Read more

How to uninstall an app that another user installed?

My process above still works, but it simply gets around a race condition issue, where Windows Update (yes, oddly enough) is in charge of wiping out “staged packages.” According to Microsoft, the “other fix” – and I still consider this issue to be a bug – is: Cause of the problem: Windows Update (WU) downloads … Read more

Windows Phone 8: Media file access

KnownFolders doesn’t work on WP8 for 3rd party apps. In terms of access on WP8 here’s what’s available: Contacts: Read access available since WP7.5, write-access available via WP8 ContactStore. Appointments: Read-access available since WP7.5. In WP8 you can add individual appointments after user confirmation via the SaveAppointmentTask. Photos: Read access to all folders available since … Read more

broadFileSystemAccess UWP

This capability is not listed in the “designer” of Package.appxmanifest, you have to add it manually via code. Go to Solution Explorer and right-click Package.appxmanifest. Select View Code. In the code view update the Package element to contain the following: <Package … xmlns:rescap=”http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities” IgnorableNamespaces=”uap mp rescap”> Do not duplicate the IgnorableNamespaces attribute, just append rescap … Read more

AdaptiveTrigger and DataTemplate

Try wrapping your DataTemplate inside a UserControl like this – <DataTemplate> <UserControl> <Grid> <VisualStateManager.VisualStateGroups> … </Grid> </UserControl> </DataTemplate> Looks like any Control that has got a Content property will work. That’s why UserControl works, so does a ContentControl. So if you replace the UserControl with a ContentControl and give it an empty Style. It should … Read more

How to resize Image in C# WinRT/winmd?

Example of how to scale and crop taken from here: async private void BitmapTransformTest() { // hard coded image location string filePath = “C:\\Users\\Public\\Pictures\\Sample Pictures\\fantasy-dragons-wallpaper.jpg”; StorageFile file = await StorageFile.GetFileFromPathAsync(filePath); if (file == null) return; // create a stream from the file and decode the image var fileStream = await file.OpenAsync(Windows.Storage.FileAccessMode.Read); BitmapDecoder decoder = await … Read more