Hello,
Welcome to our Microsoft Q&A platform!
Here is the related code, you could refer to it.
App.xaml.cs
public partial class App : Application
{
public static bool IsLogged { get; set; }
public App()
{
InitializeComponent();
...
if (IsLogged)
{
MainPage = new MasterDetailPage1();
}
else
{
MainPage = new LoginPage();
}
}
}
The detail page
<Button Text="Navigation" Clicked="Button_Clicked"/>
...
public partial class TheChildPage : ContentPage
{
public TheChildPage()
{
InitializeComponent();
}
private async void Button_Clicked(object sender, EventArgs e)
{
MasterDetailPage masterDetail = (MasterDetailPage)Application.Current.MainPage;
await masterDetail.Detail.Navigation.PushAsync(new Page1());
}
}
Best Regards,
Jarvan Zhang
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.