So the below is my xamrain forms shell I am having an issue when I am using my tab bar. I have a login page so in my App.xaml.cs I have the folowing
public App()
{
Syncfusion.Licensing.SyncfusionLicenseProvider
.RegisterLicense("");//remove license for security
DevExpress.XamarinForms.Editors.Initializer.Init();
DevExpress.XamarinForms.DataGrid.Initializer.Init();
InitializeComponent();
MainPage = new NavigationPage(new LoginPage());
}
As you see I am putting putting my main page to the login page however when I click my home button below when I am in my add pages the home page does not navigate back to the main screen.
<Shell xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:THEHOCKEYLAB.Views"
Title="THEHOCKEYLAB"
x:Class="THEHOCKEYLAB.AppShell">
<!--
The overall app visual hierarchy is defined here, along with navigation.
https://learn.microsoft.com/xamarin/xamarin-forms/app-fundamentals/shell/
-->
<Shell.Resources>
<ResourceDictionary>
<Style x:Key="BaseStyle" TargetType="Element">
<Setter Property="Shell.BackgroundColor" Value="{StaticResource Primary}" />
<Setter Property="Shell.ForegroundColor" Value="White" />
<Setter Property="Shell.TitleColor" Value="White" />
<Setter Property="Shell.DisabledColor" Value="#B4FFFFFF" />
<Setter Property="Shell.UnselectedColor" Value="#95FFFFFF" />
<Setter Property="Shell.TabBarBackgroundColor" Value="{StaticResource Primary}" />
<Setter Property="Shell.TabBarForegroundColor" Value="White"/>
<Setter Property="Shell.TabBarUnselectedColor" Value="#95FFFFFF"/>
<Setter Property="Shell.TabBarTitleColor" Value="White"/>
</Style>
<Style TargetType="TabBar" BasedOn="{StaticResource BaseStyle}" />
<Style TargetType="FlyoutItem" BasedOn="{StaticResource BaseStyle}" />
</ResourceDictionary>
</Shell.Resources>
<TabBar>
<ShellContent Title="Menu" Icon="home.png" ContentTemplate="{DataTemplate local:AdminMenuPage}" />
<ShellContent Title="Settings" Icon="settings.png" ContentTemplate="{DataTemplate local:SettingsPage}" />
</TabBar>
<!--
If you would like to navigate to this content you can do so by calling
await Shell.Current.GoToAsync("//LoginPage");
-->
<TabBar>
<ShellContent Route="LoginPage" ContentTemplate="{DataTemplate local:LoginPage}" />
</TabBar>
So for example here I have an issue
private async void btnAddStudent_Clicked(object sender, EventArgs e)
{
await Shell.Current.GoToAsync("StudentsPage");
}
When I try to come back from this page clicking the home nothing nappens can someone please explain to me as to why that is?