From: Javier Suárez Ruiz Date: Wed, 2 Oct 2019 07:56:00 +0000 (+0200) Subject: Fixed crash setting the MainPage on teh OnStart method on UWP (#7749) fixes #7537 X-Git-Tag: accepted/tizen/5.5/unified/20200421.150457~170^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=443bb1d9ec0278a0161ea7c866479cc71938b3bc;p=platform%2Fcore%2Fcsapi%2Fxsf.git Fixed crash setting the MainPage on teh OnStart method on UWP (#7749) fixes #7537 --- diff --git a/Xamarin.Forms.Platform.UAP/WindowsBasePage.cs b/Xamarin.Forms.Platform.UAP/WindowsBasePage.cs index bfcdd8d..117dcf6 100644 --- a/Xamarin.Forms.Platform.UAP/WindowsBasePage.cs +++ b/Xamarin.Forms.Platform.UAP/WindowsBasePage.cs @@ -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)