[WinRT] How to change NavigationService base frame?
See original GitHub issueI have a view BasePage, which is opened on start, and it contains Frame. I want to register NavigationService using not rootFrame, but my Frame from BasePage.
In WP it was possible to get container from code-behind:
Bootstrapper bootstrapper = Application.Current.Resources["bootstrapper"] as Bootstrapper;
and after that call RegisterNavigationService(CustomFrame);
But I didn’t found a way to do it in Win8 app. Any ideas?
Issue Analytics
- State:
- Created 10 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
NavigationService for WinRT
Some of its premises where no longer valid – most notable the way to retrieve the main application frame by accessing Application.Current.
Read more >Peer-to-peer navigation between two pages - Windows apps
In this article. 1. Create a blank app; 2. Use a Frame to navigate between pages; 3. Add basic pages; 4. Pass information ......
Read more >WinRT - How to ignore or delete page from navigation history
My question is how to do that, and how to manipulate Frame Navigation Stack on WinRT. I tried with going Back twice, but...
Read more >NavigationService - How to cancel navigation to a certain ...
In my old WinRT app i developed a navigation service that expose the navigating event, allowing to cancel navigation from view models. I...
Read more >Navigating in a WinUI 3 Desktop application
In this article we describe a minimal framework for a navigation service in a WinUI 3 Desktop application on top of a NavigationView...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
On the Frame control in your BasePage.xaml is the Frame’s DataContext set to null?
If not, the behaviour you’re seeing will happen. The reason is that the Frame’s DataContext is BasePageViewModel, which means any Page you navigate to inside that Frame will inherit the DataContext, therefore the Navigation Service won’t create IndexPageViewModel as it believes the Page already has a ViewModel.
@nigel-sampson thanks!