XAMARIN Selecting Tab in Tabpage through PRISM

105 Views Asked by At

I have a tabbedpage view with 2 child contents inside.

<?xml version="1.0" encoding="utf-8" ?>
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
            xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
            x:Class="MultiPosApp.Services.Views.FoodAndBeverageView"
            xmlns:android="clr-namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;assembly=Xamarin.Forms.Core"
            xmlns:local="clr-namespace:MultiPosApp.Services.Views"
            xmlns:prism="http://prismlibrary.com"
            prism:ViewModelLocator.AutowireViewModel="True"
            Title="Tables &amp; Menu Settings"
            BarTextColor="Black"
            BarBackgroundColor="LightGray"
            android:TabbedPage.ToolbarPlacement="Bottom"
            android:TabbedPage.BarSelectedItemColor="Black"
            x:Name="mytabpage">

    <TabbedPage.Children>
        <local:TablesView Title="TABLES" IconImageSource="Table.png" />
        <local:MenusView Title="MyMenu" IconImageSource="menusetting.png" />
    </TabbedPage.Children>
    
</TabbedPage>

When I try to use "SelectTabAsync" as shown below, the tabpage does not shift to MenusView

m_NavigationService.SelectTabAsync("MenusView");

Is there any mistake that I had been done?

0

There are 0 best solutions below