Closed kevwkev closed 5 months ago
I can't understand your idea now. Could you be more specific? NavigationView gives you a bunch of items for you to choose from for navigating. What really controls the page is the ui:Frame. If you need you have a better control of the pages, I strongly recommend you use this method:
public bool Navigate(object content, NavigationTransitionInfo infoOverride)
instead of:
public bool Navigate(Type sourcePageType, object parameter, NavigationTransitionInfo infoOverride)
I hope my idea above can work this issue out!
Setting up a NavigationView and navigating between pages poses no challenges. The inquiry I had pertained to the page content. Consider two pages, Page 1 and Page 2. Page 1 includes a textbox where we input text. Upon switching to Page 2 and then back to Page 1, the previously entered text in the TextBox is lost. This issue can be resolved by enabling NavigationCacheMode in WinUI3.
Oh but you need to use ui:Frame
to navigate between pages.
Later i may write you an example.
Yes, I understand. I am utilizing UI:Frame. As stated earlier, there are no problems with page navigation. This is merely a plea to incorporate the NavigationCacheMode feature. https://learn.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.page.navigationcachemode?view=winrt-22621
For the ui:Frame
Don't use this:
public bool Navigate(Type sourcePageType, object parameter, NavigationTransitionInfo infoOverride)
Instead, USE THIS:
public bool Navigate(object content, NavigationTransitionInfo infoOverride)
Can NavigationCacheMode be implemented to ensure that page changes are preserved when switching between pages in a NavigationView?