public static Page CurrentPage(this Application @this)
{
Argument.IsNotNull(() => @this);
var modalStack = Application.Current.MainPage.Navigation.ModalStack;
var currentPage = modalStack[modalStack.Count - 1];
if (currentPage is NavigationPage)
{
currentPage = (currentPage as NavigationPage).CurrentPage ?? currentPage;
}
return currentPage;
}
}