WPF, XAML, and C#: Integrating Windows 10 Features

3 Minute(s) to read

The following blog post presents a step-by-step guide on how to integrate Windows 10 features with your WPF desktop application written in C#.


The following section outlines the requirements for integrating Windows 10 features with your existing C# WPF application.



The following are NuGet packages that are not necessarily required, but are recommended for an easier development experience.


You will first need to familiarise yourself with some high-level concepts that are used including COM classes and objects, AppUserModel, and shell links.

Toast Activator

Your desktop application will require an implementation, or class definition that can be used for handling toast notification activations from the operating system (Windows 10). This is a class that can receive signals or requests from Windows 10 whenever a user interacts or engages with a toast notification either from the hub or the prompt once it is displayed. It looks something like this.

// The GUID CLSID must be unique to your app. Create a new GUID if copying this code.
[Guid("replaced-with-your-guid-C173E6ADF0C3"), ComVisible(true)]
public class MyNotificationActivator : NotificationActivator
    public override void OnActivated(string invokedArgs, NotificationUserInput userInput, string appUserModelId)
        // TODO: Handle activation

This code snippet defines the class that will be responsible for handling with requests from the toast notification once a user engages with it. The invoked args can be defined at a later stage once we construct the toast notification. You will need to associate your application with a GUID that can be freely generated from an online tool such as this website. Replace the example GUID string in the GuidAttribute with the one that you generated.

Project Setup

You will need to modify your existing C# project before being able to proceed in enabling toast notifications or other Windows 10 features in your application.

Open up the .csproj file for your project in a text editor, and place the following XML elements below.


Change the version number of TargetPlatformVersion to the version number of the Windows 10 SDK that you have installed. Once completed, you will be required to reload the project when returning to Visual Studio. You should now have the ability to add references to WinRT references and libraries through the Reference Manager for the C# project.

Next, you will want to add references to a couple of WinRT references (*.winmd). Add references to Windows, and Windows.UI.

Reference Manager Frontend

For convenience, you will likely want to make use of this particular third-party package for invoking toast notifications without the setup.

Start Menu Shortcuts

As stated in the MSDN documentation for toast notifications, in order for it to work your application must have an associated shortcut in the Start Menu folder for Windows 10, that contains the CLSID of the COM object that is used for handling operations from Windows 10. You can make use of the following code snippet for resolving the absolute path to the Start Menu for the current user.


Shortcut Properties

You can make use of the following third-party NuGet packages for creating a shell link to your desktop application, and appending properties to it also.

Integrating Notifications

Once you have ensured that your desktop application as a shell link that is readily available from the Start Menu directory


Gravatar for KazesLed

cialis 5mg generic administrators
http://cialis-walmart.com - cialis over the counter at walmart
is cialis the same as indian acapalis
<a href="http://cialis-walmart.com">cialis over counter walmart
</a> - cialis 10mg or 20mg search
cialis 5mg cost return to board index

Gravatar for PeterFub

<a href=http://onlinepharmacycanadaus.com/>canadian drugs online</a> approved canadian online pharmacies <a href=http://onlinepharmacycanadaus.com/>canadian medications</a>

Gravatar for Xazieranabs

cialis 20mg tablets who is online
http://tadalafilatwalmart.net - cialis over the counter
cialis experiences
<a href="http://tadalafilatwalmart.net">cialis over counter
</a> - cialis generic canada user rights
cialis vs viagra

Gravatar for PeterFub

<a href=http://canadianonlinepharmacymlp.com/>best online pet pharmacy</a> canada drugs direct <a href=http://canadianonlinepharmacymlp.com/>pharmacy technician course online</a>

Gravatar for PeterFub

<a href=http://canadianonlinepharmacymlp.com/>cialis from india online pharmacy</a> drugs from canada <a href=http://canadianonlinepharmacymlp.com/>canadian drug stores</a>