diff options
author | E.Z. Hart <hartez@users.noreply.github.com> | 2016-05-04 06:18:40 -0600 |
---|---|---|
committer | Rui Marinho <me@ruimarinho.net> | 2016-05-04 13:18:40 +0100 |
commit | a2148444bafd728090c39c1f40700b43baded1e4 (patch) | |
tree | e6e116a491df5e501269d30f63f81942c90f4645 /Xamarin.Forms.Platform.WP8 | |
parent | e7d8c5aa5784cd059cdfcf4a75b9e2c59fc9d3d0 (diff) | |
download | xamarin-forms-a2148444bafd728090c39c1f40700b43baded1e4.tar.gz xamarin-forms-a2148444bafd728090c39c1f40700b43baded1e4.tar.bz2 xamarin-forms-a2148444bafd728090c39c1f40700b43baded1e4.zip |
Add INavigationPageController (#149)
Diffstat (limited to 'Xamarin.Forms.Platform.WP8')
-rw-r--r-- | Xamarin.Forms.Platform.WP8/NavigationPageRenderer.cs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/Xamarin.Forms.Platform.WP8/NavigationPageRenderer.cs b/Xamarin.Forms.Platform.WP8/NavigationPageRenderer.cs index 35a77f21..2bd5b7b3 100644 --- a/Xamarin.Forms.Platform.WP8/NavigationPageRenderer.cs +++ b/Xamarin.Forms.Platform.WP8/NavigationPageRenderer.cs @@ -5,6 +5,7 @@ using System.Diagnostics; using System.Linq; using System.Windows; using System.Windows.Controls; +using Xamarin.Forms.Internals; namespace Xamarin.Forms.Platform.WinPhone { @@ -26,11 +27,13 @@ namespace Xamarin.Forms.Platform.WinPhone Action init = () => { - Element.PushRequested += PageOnPushed; - Element.PopRequested += PageOnPopped; - Element.PopToRootRequested += PageOnPoppedToRoot; - Element.RemovePageRequested += RemovePageRequested; - Element.InsertPageBeforeRequested += ElementOnInsertPageBeforeRequested; + var navController = (INavigationPageController)Element; + + navController.PushRequested += PageOnPushed; + navController.PopRequested += PageOnPopped; + navController.PopToRootRequested += PageOnPoppedToRoot; + navController.RemovePageRequested += RemovePageRequested; + navController.InsertPageBeforeRequested += ElementOnInsertPageBeforeRequested; Element.PropertyChanged += OnElementPropertyChanged; var platform = (Platform)Element.Platform; @@ -132,7 +135,7 @@ namespace Xamarin.Forms.Platform.WinPhone var platform = Element.Platform as Platform; if (platform != null) { - if (e.Page == Element.StackCopy.LastOrDefault()) + if (e.Page == ((INavigationPageController)Element).StackCopy.LastOrDefault()) e.Page.IgnoresContainerArea = true; e.Task = platform.PushCore(e.Page, Element, e.Animated, e.Realize).ContinueWith((t, o) => true, null); } |