Passing complex data to Components with Frame::Navigate


  • bool Windows::UI::Xaml::Controls::Frame::Navigate(   TypeName sourcePageType,    Object^ parameter )

    appears to have a rather general second parameter.  But then the remarks seem to limit it to string, char, numeric and GUID.

    So how are we suppose to communicate complex parameters to a WinRT component?  How are they supposed to be returned?  Is the idea to serialize them into a JSON string or something?




    To enable serialization of the frame's state using GetNavigationState, you must pass only basic types to this method, such as string, char, numeric, and GUID types. If you pass an object as a parameter, an entry in the frame's navigation stack holds a reference on the object until the frame is released or that entry is released upon a new navigation that diverges from the stack. In general, we discourage passing a non-basic type as a parameter to Navigate because it can’t be serialized when the application is suspended, and can consume more memory because a reference is held by the frame’s navigation stack to allow the application to go forward and back. 



    and why doesn't the documentation for C++ mention that you should use

    this->Frame->Navigate( Windows::UI::Xaml::Interop::TypeName(MyPage::typeid), ss );

    "Quickstart: Navigating between pages (Windows Store apps using C#/VB/C++ and XAML) " is also missing the C++ specific code samples.





    Thursday, September 13, 2012 11:56 PM

All replies

  • I come up a solution, we can serialize a class into a string, pass the string to next page, and then de-serizalize it.


    Best regards,


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    Friday, September 14, 2012 6:14 AM
  • How can data flow back to the calling page?

    Friday, September 14, 2012 3:40 PM