summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.MacOS
diff options
context:
space:
mode:
authorMarko B. Ludolph <MarkoBL@users.noreply.github.com>2017-08-15 19:06:07 +0200
committerRui Marinho <me@ruimarinho.net>2017-08-15 18:06:07 +0100
commit71f08bf48a91e3c7f107d5c34c4e3d9d9f5ccd30 (patch)
tree1630ce06d35235dd4fb21a4f3db970a65090b887 /Xamarin.Forms.Platform.MacOS
parent6b9730ee2b09c429c4b7dbc1b2c450938992268c (diff)
downloadxamarin-forms-71f08bf48a91e3c7f107d5c34c4e3d9d9f5ccd30.tar.gz
xamarin-forms-71f08bf48a91e3c7f107d5c34c4e3d9d9f5ccd30.tar.bz2
xamarin-forms-71f08bf48a91e3c7f107d5c34c4e3d9d9f5ccd30.zip
[macOS] ModalPage Resize Fix (#1058)
* [macOS] ModalPage Resize Fix * Added _renderer and _renderer.View null check.
Diffstat (limited to 'Xamarin.Forms.Platform.MacOS')
-rw-r--r--Xamarin.Forms.Platform.MacOS/ModalPageTracker.cs13
-rw-r--r--Xamarin.Forms.Platform.MacOS/PlatformNavigation.cs2
-rw-r--r--Xamarin.Forms.Platform.MacOS/PlatformRenderer.cs1
3 files changed, 16 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.MacOS/ModalPageTracker.cs b/Xamarin.Forms.Platform.MacOS/ModalPageTracker.cs
index c492f4cd..c02c64e0 100644
--- a/Xamarin.Forms.Platform.MacOS/ModalPageTracker.cs
+++ b/Xamarin.Forms.Platform.MacOS/ModalPageTracker.cs
@@ -41,6 +41,19 @@ namespace Xamarin.Forms.Platform.MacOS
return HideModalAsync(modal, animated);
}
+ internal void LayoutSubviews()
+ {
+ if (_renderer == null || _renderer.View == null)
+ return;
+
+ foreach(var modal in _modals)
+ {
+ var modalRenderer = Platform.GetRenderer(modal);
+ if(modalRenderer != null)
+ modalRenderer.SetElementSize(new Size(_renderer.View.Bounds.Width, _renderer.View.Bounds.Height));
+ }
+ }
+
public void Dispose()
{
Dispose(true);
diff --git a/Xamarin.Forms.Platform.MacOS/PlatformNavigation.cs b/Xamarin.Forms.Platform.MacOS/PlatformNavigation.cs
index 7af8f074..13846b6c 100644
--- a/Xamarin.Forms.Platform.MacOS/PlatformNavigation.cs
+++ b/Xamarin.Forms.Platform.MacOS/PlatformNavigation.cs
@@ -18,6 +18,8 @@ namespace Xamarin.Forms.Platform.MacOS
_animateModals = true;
}
+ public ModalPageTracker ModalPageTracker => _modalTracker;
+
public IReadOnlyList<Page> ModalStack => _modalTracker.ModalStack;
public IReadOnlyList<Page> NavigationStack => new List<Page>();
diff --git a/Xamarin.Forms.Platform.MacOS/PlatformRenderer.cs b/Xamarin.Forms.Platform.MacOS/PlatformRenderer.cs
index c0fcae35..97c44a08 100644
--- a/Xamarin.Forms.Platform.MacOS/PlatformRenderer.cs
+++ b/Xamarin.Forms.Platform.MacOS/PlatformRenderer.cs
@@ -28,6 +28,7 @@ namespace Xamarin.Forms.Platform.MacOS
{
base.ViewDidLayout();
Platform.LayoutSubviews();
+ _platformNavigation?.ModalPageTracker?.LayoutSubviews();
}
public override void ViewWillAppear()