Show Toast Notifications in WPF Applications
Theming the Toast is very easy. Simply create colors for these resource names in your app.xaml or any global resource dictionary:
<SolidColorBrush x:Key="ToastCloseButtonBackground">#ff0</SolidColorBrush>
<SolidColorBrush x:Key="ToastCloseButtonForeground">#9f1300</SolidColorBrush>
<SolidColorBrush x:Key="ToastBackground">#f0f</SolidColorBrush>
<SolidColorBrush x:Key="ToastBorderBrush">#0f0</SolidColorBrush>
<SolidColorBrush x:Key="ToastContentForeground">#f90</SolidColorBrush>
<SolidColorBrush x:Key="ToastHeaderBackground">#769</SolidColorBrush>
The toast controls will automatically bind to it. You can also change them at runtime.
Windows Toast Notifications (or simply Toasts) are flat notifications that pop up in the bottom right corner of your screen and can be accessed through the Windows Action Center. You can incorporate these notifications in your next Windows Presentation Foundation app by using this WPF-Toast control.
To see toasts in action, launch the "DemoApp" and click on any of the displayed buttons.
WPF Toast Notification offers two notification control.
Toast Control | Descriptions |
---|---|
ToastContent |
Allows you to display simple text notifications to users. The notification fades off after 0:0:1.5 time interval. |
ToastAction |
Allows you to display text and visual elements on the screen. It provides reminder functionality for the user to snooze the notification. |
Control Properties
Properties | Descriptions |
---|---|
NotificationMessage |
This is the message displayed to the user. For ToastAction , you can completely customize the appearance by setting the Content property (see demo app) |
Position |
Allows to position the toast notification at different locations on the screen or parent control. |
PositionReference |
Sets the reference of the positioning to either screen or parent control |
Toast Content
Toast Action
The WPF Toast still requires little touches and exposing of some members for client's customisation. Please, feel free to contribute to the project.