Browse Source

Make WindowNotificationManager(TopLevel) ctor nullable as it was before

Max Katz 2 years ago
parent
commit
0f85a4603d
1 changed files with 5 additions and 2 deletions
  1. 5 2
      src/Avalonia.Controls/Notifications/WindowNotificationManager.cs

+ 5 - 2
src/Avalonia.Controls/Notifications/WindowNotificationManager.cs

@@ -54,9 +54,12 @@ namespace Avalonia.Controls.Notifications
         /// Initializes a new instance of the <see cref="WindowNotificationManager"/> class.
         /// </summary>
         /// <param name="host">The TopLevel that will host the control.</param>
-        public WindowNotificationManager(TopLevel host) : this()
+        public WindowNotificationManager(TopLevel? host) : this()
         {
-            InstallFromTopLevel(host);
+            if (host is not null)
+            {
+                InstallFromTopLevel(host);
+            }
         }
 
         /// <summary>