summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.WinRT
diff options
context:
space:
mode:
authorPaul DiPietro <pauldipietro@users.noreply.github.com>2017-03-03 06:51:28 -0600
committerRui Marinho <me@ruimarinho.net>2017-03-03 12:51:28 +0000
commitb53ccf0d474f4c4d4a2679a8c7ab6c793cc2458d (patch)
treee24870a94b0bd9fce33f52dc84627ac6ceb14c38 /Xamarin.Forms.Platform.WinRT
parentbc13d3cfeeea62214f0c6f434e5f21f7117e2e1a (diff)
downloadxamarin-forms-b53ccf0d474f4c4d4a2679a8c7ab6c793cc2458d.tar.gz
xamarin-forms-b53ccf0d474f4c4d4a2679a8c7ab6c793cc2458d.tar.bz2
xamarin-forms-b53ccf0d474f4c4d4a2679a8c7ab6c793cc2458d.zip
[WinRT/UWP] Do not allow IsPresented use in Split mode on desktop (#707)
Diffstat (limited to 'Xamarin.Forms.Platform.WinRT')
-rw-r--r--Xamarin.Forms.Platform.WinRT/MasterDetailPageRenderer.cs8
1 files changed, 8 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.WinRT/MasterDetailPageRenderer.cs b/Xamarin.Forms.Platform.WinRT/MasterDetailPageRenderer.cs
index dcef680e..dfeb3921 100644
--- a/Xamarin.Forms.Platform.WinRT/MasterDetailPageRenderer.cs
+++ b/Xamarin.Forms.Platform.WinRT/MasterDetailPageRenderer.cs
@@ -168,7 +168,10 @@ namespace Xamarin.Forms.Platform.WinRT
else if (e.PropertyName == MasterDetailPage.IsPresentedProperty.PropertyName)
UpdateIsPresented();
else if (e.PropertyName == MasterDetailPage.MasterBehaviorProperty.PropertyName)
+ {
UpdateBehavior();
+ UpdateIsPresented();
+ }
else if (e.PropertyName == Page.TitleProperty.PropertyName)
UpdateTitle();
}
@@ -276,6 +279,11 @@ namespace Xamarin.Forms.Platform.WinRT
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 || Device.Idiom == TargetIdiom.Tablet) && _container.IsMasterVisible && !Element.IsPresented && Element.MasterBehavior != MasterBehavior.Popover)
+ return;
+
UpdateBehavior();
bool isPresented = !GetIsMasterAPopover() || Element.IsPresented;