Skip to content

Latest commit

 

History

History
53 lines (35 loc) · 4.83 KB

File metadata and controls

53 lines (35 loc) · 4.83 KB

WPF NotificationService - Create Interactive Notifications

NotificationService allows you to create and display feedback notifications introduced in Windows 10. Feedback notifications can be used to get a quick answer from a user. If the application has already been closed, the user can reopen it on the notification click.

image

Implementation Details

This example illustrates how to use NotificationService:

  1. Create ApplicationShortcut: MainWindow.xaml.cs (VB: MainWindow.xaml.vb).

  2. Create ApplicationActivator and register COM-Server: Activator.cs (VB: Activator.vb).

  3. Set ApplicationName and ApplicationId: MainWindow.xaml (VB: MainWindow.xaml).

  4. Create a command that invokes the notification: MainViewModel.cs (VB: MainViewModel.vb).

    The NotificationService.CreatePredefinedNotification method allows you to specify the notification's id that could be used to identify the notification with wich the user interacts. NotificationActivator passes this id to the OnActivate method's arguments parameter.

We recommend running the sample without the Visual Studio debugger. The application shortcut will be created on the first application launch in the "%APPDATA%\Microsoft\Windows\Start Menu\Programs" directory. If you move or rename the application file, you will need to manually remove the old shortcut.

Important!
Enable notifications in the Windows 10 settings before running the sample.

When the sample application is running, click the Create notification button to invoke a popup feedback notification. You can click the notification in the Windows 10 Action Center to restart the sample application once the application is closed.

Files to Review

Documentation

More Examples

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)