Template10: I want to hide menu icon of hamburger template (uwp) on login page.

Created on 26 May 2016  路  6Comments  路  Source: Windows-XAML/Template10

I do not want to add menu on login page. how can it possible.

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

All 6 comments

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 :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

marcinmarkiewicz picture marcinmarkiewicz  路  9Comments

Gh0s7 picture Gh0s7  路  6Comments

Weasy666 picture Weasy666  路  8Comments

resolutedreamer picture resolutedreamer  路  4Comments

JerryNixon picture JerryNixon  路  6Comments