Created
December 5, 2017 19:54
-
-
Save rdelrosario/b151a014ff904aded58b6e575ed63dfe to your computer and use it in GitHub Desktop.
Android SetupPageTransition
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected override void SetupPageTransition(Android.Support.V4.App.FragmentTransaction transaction, bool isPush) | |
{ | |
Page lastPage = null; | |
if (isPush) | |
{ | |
if (Element?.Navigation?.NavigationStack?.Count() >= 2) | |
{ | |
var previousPage = Element?.Navigation?.NavigationStack[Element.Navigation.NavigationStack.Count() - 2]; | |
previousPage.PropertyChanged -= LastPage_PropertyChanged; | |
} | |
lastPage = Element?.Navigation?.NavigationStack?.Last(); | |
SetupToolbarCustomization(lastPage); | |
lastPage.PropertyChanged += LastPage_PropertyChanged; | |
} | |
else if (Element?.Navigation?.NavigationStack?.Count() >= 2) | |
{ | |
var previousPage = Element?.Navigation?.NavigationStack?.Last(); | |
previousPage.PropertyChanged -= LastPage_PropertyChanged; | |
lastPage = Element?.Navigation?.NavigationStack[Element.Navigation.NavigationStack.Count() - 2]; | |
lastPage.PropertyChanged += LastPage_PropertyChanged; | |
SetupToolbarCustomization(lastPage); | |
} | |
base.SetupPageTransition(transaction, isPush); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment