diff options
author | E.Z. Hart <hartez@users.noreply.github.com> | 2017-01-23 12:42:38 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-23 12:42:38 -0700 |
commit | 2c56d6211db41a1b105ac466630dca783d5bd1ec (patch) | |
tree | 4e476c7c527198e2a5c0048bf8f44e48bb6658da /Xamarin.Forms.Platform.WinRT | |
parent | c468302e9da38354d0b8d3004ac44f39b65f5fbf (diff) | |
download | xamarin-forms-2c56d6211db41a1b105ac466630dca783d5bd1ec.tar.gz xamarin-forms-2c56d6211db41a1b105ac466630dca783d5bd1ec.tar.bz2 xamarin-forms-2c56d6211db41a1b105ac466630dca783d5bd1ec.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.cs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Xamarin.Forms.Platform.WinRT/NavigationPageRenderer.cs b/Xamarin.Forms.Platform.WinRT/NavigationPageRenderer.cs index 593a6747..d1fdee0a 100644 --- a/Xamarin.Forms.Platform.WinRT/NavigationPageRenderer.cs +++ b/Xamarin.Forms.Platform.WinRT/NavigationPageRenderer.cs @@ -397,7 +397,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); } @@ -418,8 +418,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) |