none
NavigationHelper_LoadState not so similar to OnNavigatedTo

    Question

  • private void NavigationHelper_LoadState(object sender, LoadStateEventArgs e)
            {
    
                if (e.PageState != null)
                {
                    var profile = (UserData)e.NavigationParameter;
                   
    
                }
                
            }

    What I tried to do here is collect some information on a mobile app. I wanted to all the information to repopulate the fields if the customer navigated away from the page. I simply wanted to cast the e.NavigationParameter to type UserData and then use that object. This is what I did with the OnNavigatedTo method on a blank template but using this method seems to be quite different. 

    The above image shows that NavigationParameter property is of type object. But when I try to run the program I get a compilation error saying I can't convert type String to type UserData

    I thought that the LoadState method was just the OnNavigatedTo with some Suspension management. 


    Learning to make Windows Apps

    • Moved by litdev Monday, April 11, 2016 5:15 PM
    Monday, April 11, 2016 12:22 AM

Answers

All replies