-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml.cs
33 lines (28 loc) · 941 Bytes
/
MainWindow.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System.Windows;
using Microsoft.Toolkit.Uwp.Notifications;
using Windows.UI.Notifications;
namespace IconColorIInversion
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
private ToastNotifierCompat? _notifier;
public MainWindow()
{
InitializeComponent();
}
private void Button_Click(object sender, RoutedEventArgs e)
{
_notifier ??= ToastNotificationManagerCompat.CreateToastNotifier();
var builder = new ToastContentBuilder()
.AddText("Some tilte")
.AddText("Some description")
.SetToastDuration(ToastDuration.Short)
.SetToastScenario(ToastScenario.Default);
var notification = new ToastNotification(builder.GetXml());
_notifier.Show(notification);
}
}
}