summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.UAP
diff options
context:
space:
mode:
authorSamantha Houts <samhouts@users.noreply.github.com>2017-06-01 03:09:16 -0700
committerRui Marinho <me@ruimarinho.net>2017-06-01 11:09:16 +0100
commit07c85d17007e50f549248a192c04b0222e700b2e (patch)
tree05efff42513f256132f7419d92a1254f96c073d2 /Xamarin.Forms.Platform.UAP
parentbd6bdbb50b5741d052818d8c47d3b5220325e46a (diff)
downloadxamarin-forms-07c85d17007e50f549248a192c04b0222e700b2e.tar.gz
xamarin-forms-07c85d17007e50f549248a192c04b0222e700b2e.tar.bz2
xamarin-forms-07c85d17007e50f549248a192c04b0222e700b2e.zip
[UWP] Correctly calculates height of Master Page content (#953)
* Add repro for 54036 * [UWP] Correctly calculate height of Master Page content
Diffstat (limited to 'Xamarin.Forms.Platform.UAP')
-rw-r--r--Xamarin.Forms.Platform.UAP/MasterDetailControl.cs12
1 files changed, 10 insertions, 2 deletions
diff --git a/Xamarin.Forms.Platform.UAP/MasterDetailControl.cs b/Xamarin.Forms.Platform.UAP/MasterDetailControl.cs
index 65cdf713..3c662dac 100644
--- a/Xamarin.Forms.Platform.UAP/MasterDetailControl.cs
+++ b/Xamarin.Forms.Platform.UAP/MasterDetailControl.cs
@@ -128,10 +128,18 @@ namespace Xamarin.Forms.Platform.UWP
{
get
{
- double height = ActualHeight;
+ // Use the ActualHeight of the _masterPresenter to automatically adjust for the Master Title
+ double height = _masterPresenter?.ActualHeight ?? 0;
+
+ // If there's no content, use the height of the control to make sure the background color expands.
+ if (height == 0)
+ height = ActualHeight;
+
double width = 0;
- if (_commandBar != null)
+ // On first load, the _commandBar will still occupy space by the time this is called.
+ // Check ShouldShowToolbar to make sure the _commandBar will still be there on render.
+ if (_commandBar != null && ShouldShowToolbar)
height -= _commandBar.ActualHeight;
if (_split != null)