summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.WinRT
diff options
context:
space:
mode:
authorE.Z. Hart <hartez@users.noreply.github.com>2017-01-23 12:42:38 -0700
committerKangho Hur <kangho.hur@samsung.com>2017-03-24 13:12:24 +0900
commit8ac2874b55a3f331abb58fa983b8603e08b80184 (patch)
tree8dd3a2305b3bd1eac8ee01fac37a15e6aa4ee0d0 /Xamarin.Forms.Platform.WinRT
parentb57d4e67779bc67070e90b23167a01e37c3a2f8a (diff)
downloadxamarin-forms-8ac2874b55a3f331abb58fa983b8603e08b80184.tar.gz
xamarin-forms-8ac2874b55a3f331abb58fa983b8603e08b80184.tar.bz2
xamarin-forms-8ac2874b55a3f331abb58fa983b8603e08b80184.zip
Reduce overhead of pushing existing navigation stack (#672)
* Make StackCopy less awkward * Clean up comment * Update docs * Update docs * Replace SecondToLast with an arbitrarily deep Peek method * Update docs * Handle negative depths in Peek()
Diffstat (limited to 'Xamarin.Forms.Platform.WinRT')
-rw-r--r--Xamarin.Forms.Platform.WinRT/NavigationPageRenderer.cs8
1 files changed, 5 insertions, 3 deletions
diff --git a/Xamarin.Forms.Platform.WinRT/NavigationPageRenderer.cs b/Xamarin.Forms.Platform.WinRT/NavigationPageRenderer.cs
index d6f45420..d5da8cdc 100644
--- a/Xamarin.Forms.Platform.WinRT/NavigationPageRenderer.cs
+++ b/Xamarin.Forms.Platform.WinRT/NavigationPageRenderer.cs
@@ -398,7 +398,7 @@ namespace Xamarin.Forms.Platform.WinRT
void OnPopRequested(object sender, NavigationRequestedEventArgs e)
{
- var newCurrent = (Page)PageController.InternalChildren[PageController.InternalChildren.Count - 2];
+ var newCurrent = ((INavigationPageController)Element).Peek(1);
SetPage(newCurrent, e.Animated, true);
}
@@ -419,8 +419,10 @@ namespace Xamarin.Forms.Platform.WinRT
void PushExistingNavigationStack()
{
- for (int i = ((INavigationPageController)Element).StackCopy.Count - 1; i >= 0; i--)
- SetPage(((INavigationPageController)Element).StackCopy.ElementAt(i), false, false);
+ foreach (var page in ((INavigationPageController)Element).Pages)
+ {
+ SetPage(page, false, false);
+ }
}
void SetPage(Page page, bool isAnimated, bool isPopping)