Reusing views for navigation #14698
Unanswered
prostopsih
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I register my views and viewmodels as singletons in my IoC container and reuse them where is possible, so if view was already opened in lifetime of the application, it won't be recreated, and it will save a bit of navigation time.
Originally the only issue was that same view can't be in the NavigationStack, in my case it's not likely situation.
But over time I faced another issue, if I have entries on my view, and one of them was focused at some point, on the next navigation, even if it wasn't from Pop method, the entry will become focused, so, on second navigation, there will be some native behaviour after view appeared like it was open from the Pop method but not pushed to the stack, and this is not something that I want to happen, is there any workaround to prevent this or another native behaviour, which happens on second or later opening of view?
Beta Was this translation helpful? Give feedback.
All reactions