From b53ccf0d474f4c4d4a2679a8c7ab6c793cc2458d Mon Sep 17 00:00:00 2001 From: Paul DiPietro Date: Fri, 3 Mar 2017 06:51:28 -0600 Subject: [WinRT/UWP] Do not allow IsPresented use in Split mode on desktop (#707) --- Xamarin.Forms.Platform.UAP/MasterDetailPageRenderer.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Xamarin.Forms.Platform.UAP') diff --git a/Xamarin.Forms.Platform.UAP/MasterDetailPageRenderer.cs b/Xamarin.Forms.Platform.UAP/MasterDetailPageRenderer.cs index 4a7fe033..b2b0d8b3 100644 --- a/Xamarin.Forms.Platform.UAP/MasterDetailPageRenderer.cs +++ b/Xamarin.Forms.Platform.UAP/MasterDetailPageRenderer.cs @@ -163,7 +163,7 @@ namespace Xamarin.Forms.Platform.UWP protected virtual void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e) { - if (e.PropertyName == MasterDetailPage.IsPresentedProperty.PropertyName) + if (e.PropertyName == MasterDetailPage.IsPresentedProperty.PropertyName || e.PropertyName == MasterDetailPage.MasterBehaviorProperty.PropertyName) UpdateIsPresented(); else if (e.PropertyName == "Master") UpdateMaster(); @@ -286,6 +286,11 @@ namespace Xamarin.Forms.Platform.UWP void UpdateIsPresented() { + // Ignore the IsPresented value being set to false for Split mode on desktop and allow the master + // view to be made initially visible + if (Device.Idiom == TargetIdiom.Desktop && Control.IsPaneOpen && Element.MasterBehavior != MasterBehavior.Popover) + return; + Control.IsPaneOpen = Element.IsPresented; } -- cgit v1.2.3