[TabbedPage] NavigateAsync Page inside TabbedPage
_____________
| HomePage |
| |
| |
____________
| Test1Page | Test2Page|
____________
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="PrismUnitySample.Views.CustomTabbedPage" xmlns:local="clr-namespace:PrismUnitySample.Views" Title="My App"> <TabbedPage.Children> <local:Test1Page /> <local:Test2Page /> </TabbedPage.Children> </TabbedPage>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="PrismUnitySample.Views.Test1Page" Title="Test1" BackgroundColor="Red" xmlns:mvvm="clr-namespace:Prism.Mvvm;assembly=Prism.Forms" mvvm:ViewModelLocator.AutowireViewModel="True"> <Button Command="{Binding OnLoginCommand}" Text="GO"/> </ContentPage>
public Test1PageViewModel(INavigationService navigationService) { _navigationService = navigationService; OnLoginCommand = new DelegateCommand(GoHome); } async void GoHome() { await _navigationService.NavigateAsync(new Uri($"HomePage", UriKind.Relative), null, false); }