Search code examples
template10

How to get the page type which NavigationService navigates to?


From a page A I nagivate to page B. I have overrided OnNavigatedFromAsync() on page A and I'd like to know the page type I'm coming to. Is it possible to know it?


Solution

  • NavigatingCancelEventArgs of NavigationService.Frame.Navigating event does the trick.

    It is possible to get the targetted page type via SourcePageType and cancel transition using the Cancel property.