Bernd Morgeneyer
Bernd Morgeneyer

Reputation: 109

Check if ContentPage is currently shown: Solution not working for me

I used the same title as this thread because the solutions offered there are not really useful for me:

1.) Because I used the templates generated by Visual Studio, MainPage = new AppShell();, Application.Current.MainPage is always AppShell.

2.) This page is defined as FlyoutItem but is also called over GoToAsync. So OnAppearing is called when the FlyoutItem has been initalized (but hidden by another page defined in CurrentItem), but will not be called when this page appears after selecting by the FlyoutMenu.

Upvotes: 0

Views: 46

Answers (1)

FreakyAli
FreakyAli

Reputation: 16562

If you are using Shell what you will have to do is get the current displayed Shell page.

var currentPage = Shell.Current.CurrentPage;

Upvotes: 0

Related Questions