locked
Passing or give access to data from class MainPage:Page to another class xxPage:Page

    Question

  • This may seem basic but I am having issue trying to figure out how to properly provide access to date when passing between pages.

    Example below:

    I have access data and did some manipulation in the MainPage: Page  Class (below)

    public sealed partial class MainPage : Page

    I would like to access the data in the xxPage:Page class (below) without going against the programing language operating structure

    public sealed partial class xxPage : Page

    Thanks,

    Grim

    Tuesday, February 25, 2014 6:19 PM

Answers

  • Hi,

    You can pass data between two page by use of Frame.Navigate(TypeName, Object) method. In the original page you can code like below:

    Frame->Navigate(TypeName(MainPage::typeid), ScenarioList);

    The ScenarioList can be any of type.

    In the other page you can code in the OnNavigatedTo method like below:

     void OnNavigatedTo(NavigationEventArgs^ e)
    	{
    		 auto GetParameter = (Test^)e->Parameter;
    	};
    

    For more information, you can refer to the link:

    http://msdn.microsoft.com/en-us/library/windows/apps/hh771188.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-9

    Best Wishes!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey. Thanks<br/> MSDN Community Support<br/> <br/> Please remember to &quot;Mark as Answer&quot; the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by A.B.P.Lambert Wednesday, February 26, 2014 8:28 PM
    Wednesday, February 26, 2014 3:04 AM