Edi Wang

.NET and Azure Developer

Windows Development UWP, WPF, WinForm, etc

Read System Certificates in UWP

In Windows, we can view and manage the certificates using certmgr.msc, which is a system management console included in Windows itself.  However, what if we want to view the certificates information in an UWP app? Here is the answer. First thing first, the method I use does not apply to UWP only. In fact it is from a WPF app I wrote. As Microsoft released .NET Standard 2.0, which allows me to …
UWP

Send Feedback in UWP Apps by Windows 10 Feedback Hub

After our app has been put on Microsoft Store, there are a lot of ways to get users to send feedback, such as email, store reviews, or even write our own API collect feedback. But in fact, Windows 10 Feedback Hub can also be used to send feedbacks for our own Apps. Those who are familiar with Windows Insider know that when Windows 10 is installed, the system has a Feedback Hub, which is usually …
UWP

Customize Acrylic Brush in UWP Applications

Windows 10 Fall Creators Update (Build 16299) added acrylic brush, this is a UI brush that similar to Windows 7 Aero effect. A lot in box Windows Apps, such as Calculator are updated with the acrylic brush. However, the built in brushes will not always meet our own requirments. Especially when Windows automatically disable render of acrylic, such as low power mode, or with an inactive window, it …
UWP

Apply Keyboard Short Cuts in UWP

A greate Windows App requires not only mouse and touch screen friendly, but also need to think about keyboards. Especially for some common short cuts, like Undo (CTRL + Z). So that the App can provide better user experience.  So how can we define short cut keys in UWP? Take my App Tracing as example, I need to implement short cuts for Undo (CTRL + Z). First, we need to consider which Control is …
UWP

Show Confirm Dialog When User Close UWP App

When our UWP Application deal with user data in it, e.g. like drawings or documents, we usually want to make sure user won't close the App by accident and lose their work. Just like what you see in a Office application, it will ask you if you want to save your document before close the App. For a long time, UWP could not do that in a normal way. Because it is not a general public API and it is …
UWP

Automatically Set Text Color on Accent Background in UWP

Windows 10 allows users to set accent color for the system, and in UWP apps, we usually honor those settings by using XAML pre-defined resource keys like {ThemeResource SystemControlBackgroundAccentBrush}. But regardless of how the user set default app mode to dark or light, when we apply text on accent colors, it may have some problems. For example, when the App is in light mode, the default …
XAML UWP

Configure VSTS Build for UWP Apps

UWP Apps usually require a lot of time to compile a "release" package for submitting to Windows Store, and if you are working in a team, TFS/VSTS can help your team ensure that each check-in has a success build, and make it easier for deployment and testing. Let's see a basic example of how to setup a CI build for a UWP App on VSTS. Important Pre-condition: Before you do that, please ensure that …
UWP Azure DevOps

Windows 10 UWP: Switching Languages in Your App

By default, a UWP App's UI language is automatically fits the system current language settings. However, what if the user need the ability to set a particular UI language just for your App without having to change system language? In my App, I supports Simplified Chinese and English. The user can override the system language in App's settings page: So how to do it? First, you need to have …
UWP Localization

Windows 10 UWP: How to Read and Save Settings Easily

In the UWP Application model, reading and saving settings are very similar to WinRT API. The class we are using is ApplicationData.Current.LocalSettings It is using key-value-pair to store settings. LocalSettings will stay on the user's current computer, and not being synced with thier Microsoft account. The API to save settings is: LocalSettings.Values[key] = value; To read settings:  if ( …
Windows UWP

Windows 10 UWP: How to Debug OnFileActivated Launch Failure

Today I am working on my Image Portray App, and I get my code blown up. The problem is, when the App is already started, it can open .ink file with double click from a file. But when the App is not launched, opening a .ink file to start the App will make it crash. As other UWP that supports file type association, I also use OnFileActivated event to launch my App. This kind of problem could not be …
Debug Visual Studio UWP