[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Collapse]Messages, Notifications and Dialogs
    XtraMessageBox
    Input Box
    XtraDialog
    Flyout Dialog
    Flyout Panel
   [Expand]Alert Windows
    Toast Notification Manager
    WinRTLiveTileManager
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Toast Notification Manager

The Toast Notification Manager component shows toast notifications - a Windows 10 version of traditional alert windows.

Note

Toast notifications can only be displayed in Windows 8.0 or higher. For older Windows versions, use alert windows instead.

An application can display multiple notifications simultaneously, or one notification multiple times at once. The ToastNotification object which represents a notification can be visualized using one of nine predefined templates. The notification can also play a sound when shown.

Expanded Create Notifications

Follow the steps below to create toast notifications.

  1. Locate the ToastNotificationManager component in your Visual Studio toolbox and drop it onto the form.

  2. Windows allows toast notifications only for those apps that are pinned to the Start menu, so make sure your application has a valid shortcut with an Application User Model ID. For debugging purposes, invoke the component's smart tag and click the "Create Application Shortcut" link.

  3. Invoke the manager's smart-tag and click the Edit Notifications... link.

  4. In the Collection Editor dialog that pops up, click the Add button to add a notification. This creates new ToastNotification objects and add them to the manager's ToastNotificationsManager.Notifications collection. You can customize the notification settings in the property grid.

  5. To display a specific notification, use the ToastNotificationsManager.ShowNotification method.

Expanded Manage End-User Interactions

Depending on end-user actions, the following events rise.

  • ToastNotificationsManager.Activated - occurs if an end-user clicks this notification. Handle this event to check which notification was clicked, and perform specific actions depending on the result. The code below illustrates an example.
  • ToastNotificationsManager.UserCancelled - occurs if an end-user closes the notification.
  • ToastNotificationsManager.TimedOut - occurs when an end-user does not respond to the notification, and the notification is hidden after a certain period. The code below illustrates how to show the notification again.
  • ToastNotificationsManager.Hidden - occurs when a toast notification is hidden via the ToastNotificationsManager.HideNotification or ToastNotificationsManager.HideNotifications method.
  • ToastNotificationsManager.Dropped - fires when a notification is canceled due to end-user's system settings.

Expanded Customize Notifications with the "Generic" Template

The following XML markup describes toast notification's content layout with the "Generic" template applied:

You can handle the ToastNotificationsManager.UpdateToastContent event to modify this template using the API the System.XML namespace provides. For instance, the following code adds a group with two subgroups to the notification layout. Each subgroup displays two additional text blocks, arranged vertically.

Expanded Notes

  • The notification background color is chosen automatically by the operating system, you cannot modify it manually.
  • Notifications are displayed by the operating system, so they can remain visible even after an end-user closes the application.
  • Windows 8-styled notifications automatically display a shortcut icon in the bottom right corner. This icon cannot be removed.
  • The number of notifications that a visible simultaneously depends on the end-user's system settings.
  • Windows 10 Anniversary Update (Redstone 1, build 1607) and newer versions support the Generic notification template.

Is this topic helpful?​​​​​​​