summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.WinRT
diff options
context:
space:
mode:
authorPaul DiPietro <paul.dipietro@me.com>2016-05-26 19:14:56 (GMT)
committerkingces95 <kingces95@users.noreply.github.com>2016-05-26 19:14:56 (GMT)
commitb17cb55f5710cfc14a4dbfe0182e94df47d83bd3 (patch)
tree6a85c90a1f6ce7a0838c45394977070174ce4568 /Xamarin.Forms.Platform.WinRT
parent349336dbf12fb158f7731ece7fb1524cb1f5808a (diff)
downloadxamarin-forms-b17cb55f5710cfc14a4dbfe0182e94df47d83bd3.zip
xamarin-forms-b17cb55f5710cfc14a4dbfe0182e94df47d83bd3.tar.gz
xamarin-forms-b17cb55f5710cfc14a4dbfe0182e94df47d83bd3.tar.bz2
[8.1/UWP] Fix PopToRootAsync functioning incorrectly (#185)
When using PopToRootAsync on 8.1/UWP, the stack was being cleared but the actual page was not being set due to a missing event handler on the NavigationPageRenderer.
Diffstat (limited to 'Xamarin.Forms.Platform.WinRT')
-rw-r--r--Xamarin.Forms.Platform.WinRT/NavigationPageRenderer.cs7
1 files changed, 7 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.WinRT/NavigationPageRenderer.cs b/Xamarin.Forms.Platform.WinRT/NavigationPageRenderer.cs
index 9fe59ba..6e8edf5 100644
--- a/Xamarin.Forms.Platform.WinRT/NavigationPageRenderer.cs
+++ b/Xamarin.Forms.Platform.WinRT/NavigationPageRenderer.cs
@@ -157,6 +157,7 @@ namespace Xamarin.Forms.Platform.WinRT
{
((INavigationPageController)oldElement).PushRequested -= OnPushRequested;
((INavigationPageController)oldElement).PopRequested -= OnPopRequested;
+ ((INavigationPageController)oldElement).PopToRootRequested -= OnPopToRootRequested;
oldElement.InternalChildren.CollectionChanged -= OnChildrenChanged;
oldElement.PropertyChanged -= OnElementPropertyChanged;
}
@@ -187,6 +188,7 @@ namespace Xamarin.Forms.Platform.WinRT
Element.PropertyChanged += OnElementPropertyChanged;
((INavigationPageController)Element).PushRequested += OnPushRequested;
((INavigationPageController)Element).PopRequested += OnPopRequested;
+ ((INavigationPageController)Element).PopToRootRequested += OnPopToRootRequested;
Element.InternalChildren.CollectionChanged += OnChildrenChanged;
if (!string.IsNullOrEmpty(Element.AutomationId))
@@ -377,6 +379,11 @@ namespace Xamarin.Forms.Platform.WinRT
SetPage(newCurrent, e.Animated, true);
}
+ void OnPopToRootRequested(object sender, NavigationRequestedEventArgs e)
+ {
+ SetPage(e.Page, e.Animated, true);
+ }
+
void OnPushRequested(object sender, NavigationRequestedEventArgs e)
{
SetPage(e.Page, e.Animated, false);