5,381 questions
Odds are your MainPage will not be the actual page you want, but a MasterDetailPage or NavigationPage or TabbedPage or Shell, so you need to dig a little deeper. Besides that, using the type of the page is probably the best option.
// Assuming your MainPage is a NavigationPage and MyAddress is the class name of the page you want
var navPage = Application.Current.MainPage as NavigationPage;
if (navPage?.CurrentPage is MyAddress)
{
// do something
}