Open Nurgo opened 1 year ago
I think what's happening is that it's detecting that Item1 is in the back stack, so is just causing current page to refresh. Do you intend to have multiple instances of item1 in the backstack? Also, what's the relationship between Main, Details and Item1/2 are they all just page navigational on the frame? If so, don't use nested routes - this is only used when you have nested regions eg Tabs inside a Page
Hi @nickrandolph, thank you for your response.
I don't think this is the cause of the problem. I've tried adding the item ID to the navigation path and the problem still occurs.
"Main" is the main page, "Detail" is a Frame within the main page, which is used to display the Item1View and Item2View pages.
I'm not sure I fully understand the role of nested routes, but I've tried without them with the same result: when I navigate back to an Item1 object after displaying an Item2, the Navigator no longer creates the correct ViewModel. You can easily reproduce this problem with the small project I've included.
What I want is simply to be able to navigate between pages of different types within a Frame. Am I doing it wrong?
Hi @nickrandolph,
I've been working extensively on this issue and have tried almost every navigation method available, including the use of query parameters in the routes. Despite all efforts, the problem persists: Uno Extensions seems unable to sequentially display multiple types of ViewModels within the same frame.
I've attached a minimalistic project to the initial post to demonstrate the issue. I strongly believe this is a bug within Uno Extensions and would greatly appreciate it if you could take the time to test the attached project and look into this matter.
Thank you for your attention to this issue.
Navigation on the frame currently doesn't support having the same page appear multiple times in the backstack - we detect that the page is in the back stack so attempt to update the current viewmodel. This is a bug. However, the workaround for what you want to do is to change the Frame to be a ContentControl - this will work unless you need the Frame to support going back to previous pages
Thanks for your quick response, your workaround did the trick!
I'll leave this issue open for the moment as I think we should add support for having the same page on the backstack multiple times. The exception to this will be if the page is the current page and you're attempting to navigate to the same page. In this case the page will just be updated with a new view model instance
@nickrandolph what is the status lately for this issue please?
Current behavior
I have 2 classes 'Item1' and 'Item2', with associated Pages and ViewModels.
I use nested navigation to display these objects in a Frame.
Here's the definition of the ViewMap and RouteMap I'm using:
And here is how I navigate between items:
Expected behavior
In step 3, an 'Item1ViewModel' should have been created, not an 'Item2ViewModel'.
How to reproduce it (as minimally and precisely as possible)
Here is a minimal project to reproduce the problem: FrameNavigationUno.zip
Environment
Nuget Package:
Package Version(s):
Tested on 2.3.10 and 2.4.2.
Affected platform(s):
Visual Studio:
Relevant plugins: