PrismV7Sample icon indicating copy to clipboard operation
PrismV7Sample copied to clipboard

[TabbedPage] NavigateAsync Page inside TabbedPage

Open beisienlin opened this issue 4 years ago • 0 comments

_____________ |  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); }

beisienlin avatar Sep 30 '21 00:09 beisienlin