feat: enhance NotificationDemo.

This commit is contained in:
Zhang Dian
2024-08-14 20:50:54 +08:00
parent a328e2bb99
commit 6630d04565
2 changed files with 22 additions and 20 deletions

View File

@@ -22,6 +22,15 @@ public partial class NotificationDemo : UserControl
_manager = new WindowNotificationManager(topLevel) { MaxItems = 3 };
}
private void PositionButton_OnClick(object? sender, RoutedEventArgs e)
{
if (sender is RadioButton b && b.Content is string s)
{
Enum.TryParse<NotificationPosition>(s, out var t);
_manager.Position = t;
}
}
private void NormalButton_OnClick(object? sender, RoutedEventArgs e)
{
if (sender is Button b && b.Content is string s)
@@ -32,16 +41,6 @@ public partial class NotificationDemo : UserControl
}
}
private void PositionButton_OnClick(object? sender, RoutedEventArgs e)
{
if (sender is Button b && b.Content is string s)
{
Enum.TryParse<NotificationPosition>(s, out var t);
_manager.Position = t;
_manager?.Show(new Notification(t.ToString(), "This is message"));
}
}
private void LightButton_OnClick(object? sender, RoutedEventArgs e)
{
if (sender is Button b && b.Content is string s)