Hello,
Welcome to Microsoft Q&A!
In shell project even a simply ShellContent
will be wrapped inside flyout menu .
The best way is to set LoginPage as MainPage in App af frist .
And then change the MainPage to AppShell
after login successfully .
Update
Just a simple sample
Route
static class Route
{
private static Dictionary<string,Type> dic = new Dictionary<string, Type>();
public static void RegisterRoute(string path , Type type)
{
if (path == null || path.Length == 0) return;
dic[path] = type;
}
public static void GoToAsync(string page)
{
if (dic[page] == null)
{
//invalid page
return;
}
var _p = Activator.CreateInstance(dic[page]) as Page;
if (App.Current.MainPage == null)
{
App.Current.MainPage = new NavigationPage(_p);
return;
}
App.Current.MainPage.Navigation.PushAsync( _p,true);
}
}
App
public App()
{
InitializeComponent();
Route.RegisterRoute("login", typeof(LoginPage));
Route.RegisterRoute("login/main", typeof(MainPage));
Route.GoToAsync("login");
}
LoginPage
private void Button_Clicked(object sender, EventArgs e)
{
Route.GoToAsync("login/main");
}
Best Regards,
Cole Xia
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.