Вы хотите добиться этого, как этот GIF?

Вы можете добавить x: Имя для TabBar
в AppShell.xml
, как это код.
<TabBar x:Name="myTabBars">
<Tab Title="Browse" Icon="tab_feed.png">
<ShellContent ContentTemplate="{DataTemplate local:ItemsPage}" />
</Tab>
<Tab Title="About" Icon="tab_about.png">
<ShellContent ContentTemplate="{DataTemplate local:AboutPage}" />
</Tab>
</TabBar>
В AppShell.xml.cs
откройте эту вкладку.
public partial class AppShell : Xamarin.Forms.Shell
{
// public static Shell myshell;
public static TabBar mytabbar;
public AppShell()
{
InitializeComponent();
mytabbar = myTabBars;
}
}
Используйте ее в ContentPage
.
private void Button_Clicked(object sender, EventArgs e)
{
ShellSection shell_section = new ShellSection
{
Title = "home",
};
shell_section.Items.Add(new ShellContent() { Content = new HomePage() });
AppShell.mytabbar.Items.Add(shell_section);
}