Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Federerer/Notifications.Wpf
Toast notifications for WPF
https://github.com/Federerer/Notifications.Wpf
Last synced: 13 days ago
JSON representation
Toast notifications for WPF
- Host: GitHub
- URL: https://github.com/Federerer/Notifications.Wpf
- Owner: Federerer
- License: mit
- Created: 2017-02-12T20:51:04.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-10-20T22:40:21.000Z (over 2 years ago)
- Last Synced: 2024-05-29T11:38:24.545Z (30 days ago)
- Language: C#
- Size: 51.8 KB
- Stars: 631
- Watchers: 18
- Forks: 136
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-wpf - Notifications.Wpf - (FREE, OPEN SOURCE) WPF toast notifications. (UI Controls / Individual Controls)
- awesome-stars - Notifications.Wpf
README
# Notifications.Wpf
WPF toast notifications.![Demo](http://i.imgur.com/UvYIVFV.gif)
### Installation:
```
Install-Package Notifications.Wpf
```
### Usage:#### Notification over the taskbar:
```C#
var notificationManager = new NotificationManager();notificationManager.Show(new NotificationContent
{
Title = "Sample notification",
Message = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
Type = NotificationType.Information
});
```#### Notification inside application window:
- Adding namespace:
```XAML
xmlns:notifications="clr-namespace:Notifications.Wpf.Controls;assembly=Notifications.Wpf"
```
- Adding new NotificationArea:
```XAML```
- Displaying notification:
```C#
notificationManager.Show(
new NotificationContent {Title = "Notification", Message = "Notification in window!"},
areaName: "WindowArea");
```#### Simple text with OnClick & OnClose actions:
```C#
notificationManager.Show("String notification", onClick: () => Console.WriteLine("Click"),
onClose: () => Console.WriteLine("Closed!"));
```
### Caliburn.Micro MVVM support:
- App.xaml:
```XAML
xmlns:controls="clr-namespace:Notifications.Wpf.Controls;assembly=Notifications.Wpf"[...]
<Style.Resources>
<DataTemplate DataType="{x:Type micro:PropertyChangedBase}">
<ContentControl cal:View.Model="{Binding}"/>
</DataTemplate>
```
- ShellViewModel:
```C#
var content = new NotificationViewModel(_manager)
{
Title = "Custom notification.",
Message = "Click on buttons!"
};_manager.Show(content, expirationTime: TimeSpan.FromSeconds(30));
```
- NotificationView:
```XAML
```
- Result:![Demo](http://i.imgur.com/G1ZU2ID.gif)