Skip to main content


  • 4 minutes to read

The NotificationService allows you to display popup notifications in your applications. You can display native Windows 10/11 notifications or create custom ones.

Create a Native Windows 10/11 Notification

NotificationService Windows 10 Style

To display a native Windows 10/11 notification, do the following:

  1. Create an application shortcut. Do one of the following:

    • Set the NotificationService.CreateApplicationShortcut property to true.
    • Create an application shortcut and specify its application id, name, icon, and activator:

      using System.Windows;
      using DevExpress.Data;
      // ...
      public partial class MainWindow : Window {
          public MainWindow() {
          void RegisterApplication() {
              if(!ShellHelper.IsApplicationShortcutExist(ApplicationName)) {
                  ShellHelper.TryCreateShortcut(ApplicationID, ApplicationName, null, typeof(CustomNotificationActivator));
          // ...
  2. Create an ApplicationActivator instance and register a COM-Server.

    [Guid("5A430E6E-2E66-4A46-BBFA-A5CC432673A0"), ComVisible(true)]
    public class CustomNotificationActivator : ToastNotificationActivator {
        public override void OnActivate(string arguments, Dictionary<string, string> data) {
            Application.Current.Dispatcher.Invoke(() => {
  3. Add the NotificationService to the Interaction.Behaviors collection and specify the ApplicationId. Set the UseWin8NotificationsIfAvailable property to true.

        <dxmvvm:NotificationService PredefinedNotificationTemplate="LongText"
                                    ApplicationActivator="{x:Type local:CustomNotificationActivator}"
                                    ApplicationName="{x:Static local:MainWindow.ApplicationName}">
                <Binding Source="{x:Static local:MainWindow.ApplicationID}" />

When multiple native Windows notifications are displayed simultaneously, the optional Id parameter of the NotificationService.CreatePredefinedNotification method enables the service to identify the notification with which the user interacts. NotificationActivator passes the Id value to the arguments parameter of the OnActivate method.


View Example: Create Interactive Notifications

Create a Custom Notification

You can use the NotificationService to create a custom notification that does not depend on the Windows 10/11 notification API.

NotificationService - Custom Notifications

Use the NotificationService.CustomNotificationTemplate property to define a custom notification layout.

<UserControl x:Class="DXSampleNotificationSevice.View.MainView"
    DataContext="{dxmvvm:ViewModelSource Type={x:Type ViewModel:MainViewModel}}">
        <DataTemplate x:Key="CustomNotificationTemplate">
            <Border Background="White" BorderThickness="1" BorderBrush="Black">
                <StackPanel Orientation="Vertical" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                    <TextBlock HorizontalAlignment="Left" Text="{Binding Caption}" Foreground="Blue" FontSize="20" FontWeight="Bold" Margin="5"/>
                    <TextBlock HorizontalAlignment="Center" Text="{Binding Content}" Foreground="Black" FontSize="16" Margin="3"/>
        <dxmvvm:NotificationService CustomNotificationTemplate="{StaticResource CustomNotificationTemplate}" CustomNotificationPosition="BottomRight" />
        <Button Content="Show Custom Notification" Command="{Binding ShowCustomNotificationCommand}" VerticalAlignment="Center" Height="30"/>

To create a custom notification, use the NotificationService.CreateCustomNotification method. This method requires a notification’s View Model as a parameter.

public class MainViewModel {
    protected virtual INotificationService CustomNotificationService { get { return null; } }
    public async void ShowCustomNotification() {
        CustomNotificationViewModel vm = ViewModelSource.Create(() => new CustomNotificationViewModel());
        vm.Caption = "Custom Notification";
        vm.Content = String.Format("Time: {0}", DateTime.Now);
        INotification notification = CustomNotificationService.CreateCustomNotification(vm);
        NotificationResult result = await notification.ShowAsync();
    void ProcessNotificationResult(NotificationResult result) {

Use the INotification.ShowAsync method to display the created notification. This method returns a NotificationResult enumeration value depending on how the notification is displayed and which notification element the user clicks. The ShowAsync method returns the following values depending on the notification result:

  • Activated, if the user clicks the notification.
  • UserCanceled, if the user clicks the notification’s close button.
  • TimedOut, if the user does not click the notification within the time span specified in the NotificationService.CustomNotificationDuration or NotificationService.PredefinedNotificationDuration property.
  • ApplicationHidden, if the INotification.Hide method is called while the notification is displayed.
  • Dropped, if the system’s notification queue is full and the notification cannot be displayed.


View Example: Use the NotificationService to Display Notifications