Thursday, September 26, 2013

Windows Phone 8 - Navigate To and From Page

I needed a solution to change the state of an element when going back to the page where it was.
I tried the Loaded event, but this did not do the trick.
What worked was Page Navigation:

protected override void OnNavigatedFrom(System.Windows.Navigation.NavigationEventArgs e)
{
    base.OnNavigatedFrom(e);

    // code
}

protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
    base.OnNavigatedTo(e);

    // code
}

Source: http://nicksnettravels.builttoroam.com/post/2011/03/07/Windows-Phone-7-Tombstone-Frustration.aspx

No comments:

Post a Comment