diff options
Diffstat (limited to 'Xamarin.Forms.Platform.WinRT')
-rw-r--r-- | Xamarin.Forms.Platform.WinRT/Platform.cs | 30 |
1 files changed, 5 insertions, 25 deletions
diff --git a/Xamarin.Forms.Platform.WinRT/Platform.cs b/Xamarin.Forms.Platform.WinRT/Platform.cs index 75dd772c..e9f6b95c 100644 --- a/Xamarin.Forms.Platform.WinRT/Platform.cs +++ b/Xamarin.Forms.Platform.WinRT/Platform.cs @@ -213,14 +213,14 @@ namespace Xamarin.Forms.Platform.WinRT return new SizeRequest(); } - internal virtual Rectangle WindowBounds + internal virtual Rectangle ContainerBounds { get { return _bounds; } } internal void UpdatePageSizes() { - Rectangle bounds = WindowBounds; + Rectangle bounds = ContainerBounds; if (bounds.IsEmpty) return; foreach (Page root in _navModel.Roots) @@ -435,27 +435,7 @@ namespace Xamarin.Forms.Platform.WinRT void UpdateBounds() { - _bounds = new Rectangle(0, 0, _page.ActualWidth, _page.ActualHeight); -#if WINDOWS_UWP - StatusBar statusBar = MobileStatusBar; - if (statusBar != null) - { - bool landscape = Device.Info.CurrentOrientation.IsLandscape(); - bool titleBar = CoreApplication.GetCurrentView().TitleBar.IsVisible; - double offset = landscape ? statusBar.OccludedRect.Width : statusBar.OccludedRect.Height; - - _bounds = new Rectangle(0, 0, _page.ActualWidth - (landscape ? offset : 0), _page.ActualHeight - (landscape ? 0 : offset)); - - // Even if the MainPage is a ContentPage not inside of a NavigationPage, the calculated bounds - // assume the TitleBar is there even if it isn't visible. When UpdatePageSizes is called, - // _container.ActualWidth is correct because it's aware that the TitleBar isn't there, but the - // bounds aren't, and things can subsequently run under the StatusBar. - if (!titleBar) - { - _bounds.Width -= (_bounds.Width - _container.ActualWidth); - } - } -#endif + _bounds = new Rectangle(0, 0, _container.ActualWidth, _container.ActualHeight); } void OnRendererSizeChanged(object sender, SizeChangedEventArgs sizeChangedEventArgs) @@ -481,7 +461,7 @@ namespace Xamarin.Forms.Platform.WinRT previousPage.Cleanup(); } - newPage.Layout(new Rectangle(0, 0, _page.ActualWidth, _page.ActualHeight)); + newPage.Layout(ContainerBounds); IVisualElementRenderer pageRenderer = newPage.GetOrCreateRenderer(); _container.Children.Add(pageRenderer.ContainerElement); @@ -726,7 +706,7 @@ namespace Xamarin.Forms.Platform.WinRT if (Device.Idiom == TargetIdiom.Phone) { - double height = WindowBounds.Height; + double height = _page.ActualHeight; stack.Height = height; stack.Width = size.Width; border.BorderThickness = new Windows.UI.Xaml.Thickness(0); |