How to Navigate from and to in TabView control in Prism Xamarin Forms #2482
Replies: 1 comment
-
Prism does not have an out of the box way for you to work with 3rd party controls. Such integrations require custom support. For instance Prism cannot work with Rg.Plugins.Popup directly because it is 3rd party and such support only comes with the Prism.Plugin.Popups package. In your particular case there is no support package so you will need to write some level of integration yourself. In order to try to support this you would need to look at Prism.Regions and write a custom Region Adapter. As the Region support for Prism.Forms is based on the implementation for WPF I would suggest that you look at this simple sample from the WPF Sample's along with some of the legacy docs on the subject... and finally the actual built-in adapters for Prism.Forms |
Beta Was this translation helpful? Give feedback.
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 have a content page which has the TabView control as follows:
The Items to the TabView are created in "contentPage code behind":
Now the problem is when I am on the UsersPage/TabSelected,There is a button, when that is clicked I want to go to "AddUserPage" . So in the ViewModel of UsersPage I have:
The command is ran but it doesn't go anywhere. Although the AddUserPage and its ViewModel is registered in the App.xaml.cs. The navigation only works if I do the following:
which I don't want. I want to navigate from my selected tab to anywhere(relatively) and come back when back button is clicked. How can I solve this problem?
I also tried instructions on https://github.com/PrismLibrary/Prism-Documentation/blob/master/docs/xamarin-forms/navigation/working-with-tabbedpages.md/#L1 but looks like problem might be the tabview on content page and the navigating from that. Please help.
So i put INavigationAware in AddUserPage and also in its AddUserPageViewModel, The constructor of AddUserPage is called and void OnNavigatedTo(INavigationParameters parameters) for both xaml.cs and viewmodel, but AddUserPage does not show up.
The only way it is working is when I set await NavigationService.NavigateAsync($"/ContentPageWhereTabsAre/{str}"); that resets the stack and cant go back
Beta Was this translation helpful? Give feedback.
All reactions