locked
NavigationHelper_LoadState not so similar to OnNavigatedTo RRS feed

  • 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

  • Hello,

    This should be asked in Microsoft's ASP.Net forums:

    http://forums.asp.net/

    As Microsoft's ASP.Net forums are on a different platform, we cannot move the question for you.

    Karl


    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book: Windows PowerShell 2.0 Bible
    My E-mail: -join('6D73646E5F6B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

    Monday, April 11, 2016 9:53 PM

All replies

  • Ummm. This is the Small Basic forum. Did you read the 

    PLEASE READ BEFORE POSTING


    It is written: "'As surely as I live,' says the Lord, 'every knee will bow before me; every tongue will acknowledge God.'" Romans 14:11

    Monday, April 11, 2016 3:16 AM
  • Hello,

    This should be asked in Microsoft's ASP.Net forums:

    http://forums.asp.net/

    As Microsoft's ASP.Net forums are on a different platform, we cannot move the question for you.

    Karl


    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book: Windows PowerShell 2.0 Bible
    My E-mail: -join('6D73646E5F6B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

    Monday, April 11, 2016 9:53 PM