misc: fix a build warning.

This commit is contained in:
rabbitism 2023-02-03 23:04:03 +08:00
parent 2d11584282
commit f86ad05a01

View File

@ -12,7 +12,7 @@ namespace Semi.Avalonia.Demo.Pages;
public partial class NotificationDemo : UserControl public partial class NotificationDemo : UserControl
{ {
private WindowNotificationManager _manager; private WindowNotificationManager? _manager;
public NotificationDemo() public NotificationDemo()
{ {
InitializeComponent(); InitializeComponent();
@ -29,7 +29,7 @@ public partial class NotificationDemo : UserControl
{ {
if (sender is Button b && b.Content is string s && Enum.TryParse<NotificationType>(s, out NotificationType t)) if (sender is Button b && b.Content is string s && Enum.TryParse<NotificationType>(s, out NotificationType t))
{ {
_manager.Show(new Notification(t.ToString(), "This is message", t)); _manager?.Show(new Notification(t.ToString(), "This is message", t));
} }
} }
} }