mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-04-23 01:46:35 +08:00
misc: fix a build warning.
This commit is contained in:
@@ -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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user