You can't get name of your page using nameof(). Since your page is instance of Page type. What you can do is cast the page to it's type and then check it.
if(stack[indexForPreviousPage] is SomePageInMyApp myPage)
{
// Do stuff using page
}