I do not want to add menu on login page. how can it possible.
Use a ModalDialog page which will actually cover your app totally as should be the case for login. No programming effort to hide or reveal app menus -- when you enable the Login ModalDialog page, it only shows the controls for credential input, and once it's done with authentication, it disables the ModalDialog page and you'd find your app which was previously covered. I think this is the correct design pattern for Login (in my opinion). You also need to deal with restoring from suspension but that is another issue down the road. The Search and Login Sample project should put you on the right track.
Can you provide sample code for it ?
I have gone down the road of navigating to a login page if it doesn't have a jwt from webapi. navigateto sets IsFullScreen = true going to login page, once islogged it will set buttons based roles then navigateto mainpage setting isfullscreen to false
https://github.com/Windows-XAML/Template10/issues/577
IN App.xaml.cs
public override async Task OnInitializeAsync(IActivatedEventArgs args)
{
if (Window.Current.Content as ModalDialog == null)
{
// create a new frame
var nav = NavigationServiceFactory(BackButton.Attach, ExistingContent.Include);
// create modal root
Window.Current.Content = new ModalDialog
{
DisableBackButtonWhenModal = true,
Content = new Shell(nav),
ModalContent = new Busy(),
};
}
await Task.CompletedTask;
}
Above method is used for add model dialog but how can i disable it on login page ?
If you want to hide the HamburgerMenu, set IsFullScreen to true. That's it :)
Most helpful comment
I have gone down the road of navigating to a login page if it doesn't have a jwt from webapi. navigateto sets IsFullScreen = true going to login page, once islogged it will set buttons based roles then navigateto mainpage setting isfullscreen to false