Fixed crash setting the MainPage on teh OnStart method on UWP (#7749) fixes #7537
authorJavier Suárez Ruiz <javiersuarezruiz@hotmail.com>
Wed, 2 Oct 2019 07:56:00 +0000 (09:56 +0200)
committerRui Marinho <me@ruimarinho.net>
Wed, 2 Oct 2019 07:56:00 +0000 (08:56 +0100)
Xamarin.Forms.Platform.UAP/WindowsBasePage.cs

index bfcdd8d..117dcf6 100644 (file)
@@ -48,7 +48,11 @@ namespace Xamarin.Forms.Platform.UWP
                void OnApplicationPropertyChanged(object sender, PropertyChangedEventArgs e)
                {
                        if (e.PropertyName == "MainPage")
+                       {
+                               if (Platform == null)
+                                       RegisterWindow(_application.MainPage);
                                Platform.SetPage(_application.MainPage);
+                       }
                }
 
                void OnApplicationResuming(object sender, object e)