-
Notifications
You must be signed in to change notification settings - Fork 22
Getting started
mohamed magdy edited this page Dec 17, 2016
·
4 revisions
Step by step guide to display the toast notification with the default style.
- Get the latest WPFToastNotification release and unzip its contents to disk or install the WPFNotification package using NuGet.
- Open Visual Studio and open an existing WPF application or create a new WPF Application project.
- Add an assembly reference to WPFNotification.dll
- Modify the App.xaml and add the following resource dictionary reference:
` <Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/WPFNotification;component/Assets/NotificationUI.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>`
notice that : If you install WPFNotification package using NuGet, Automatically it will add the assembly reference and modify App.xaml for you.
- If you are using MVVM pattern you need to do the following steps:
- Inject
INotificationDialogServiceinto your viewModel. - Create
Notificationobject with yourTitle,Messageand optionalImgURL(if null it will display the default predefined image). - Finally call the
NotificationDialogServiceObject.ShowNotificationWindow(NotificationObject)method with notification object.
- Inject
- If you are using Code-Behind you need to do the following steps:
- Create
INotificationDialogServiceobject. - Create
Notificationobject with yourTitle,Messageand optionalImgURL(if null it will display the default predefined image). - Finally call the
NotificationDialogServiceObject.ShowNotificationWindow(NotificationObject)method with notification object.
- Create