Link on same xaml page

Apr 21, 2013 at 9:12 AM
Edited Apr 21, 2013 at 3:31 PM
hi,
I have a small problem using this great framework.

To simplify the situation, I defined the LinkGroup in the following manner:
<mui:LinkGroup DisplayName="Group 1" x:Name="lgGroup1">
            <mui:LinkGroup.Links>
                <mui:Link DisplayName="List" Source="/UI/Pages/List.xaml" />
                <mui:Link DisplayName="Page1" Source="/UI/Content/Page#1.xaml" />
                <mui:Link DisplayName="Page2" Source="/UI/Content/Page#2.xaml" />
            </mui:LinkGroup.Links>
        </mui:LinkGroup>
Through the fragment #1, #2 I pass the code of the element to open.

I would like to instantiate every time a new instance of my PAGE object , instead every time I open a link I notice that the PAGE class remains that of the previous link.

I hope my bad English is clear enough.
Thanks in advance
Coordinator
Apr 23, 2013 at 11:00 PM
Fragment navigation keeps the current content alive, there is currently no way to enforce a reload of the page. Can you provide some more details about your scenario that requires page reloading?
Apr 24, 2013 at 6:22 AM
Edited Apr 24, 2013 at 6:24 AM
I have a datagrid that contains a list of documents.
On each row of the datagrid there is a button for editing the document. (green, blue)
There is also a button for creating a new document (red).

The creation of a new document and edit rows, create a dynamic link in the menu.
When I switch from one link to another, the document instance is always the same.
I would like to maintain separate instances to allow opening multiple documents.

Image
Coordinator
Apr 24, 2013 at 8:54 PM
Edited Apr 24, 2013 at 8:57 PM
Okay, so you need multiple instances of the same page but with different content. The solution is actually fairly simple, do not use fragment navigation. Use query strings instead, (use ? instead of # in your link uris). This will ensure that pages are instantiated for each unique query string. Make sure your page implements IContent and then in your OnNavigatedTo method implementation you can query the used query string to load the appropiate document.
Apr 25, 2013 at 7:42 AM
Thanks, works great.
It's truly an excellent framework.