Skip to content
Philip Colmer edited this page Oct 4, 2016 · 3 revisions

#Welcome to the Hamburger template The Hamburger template builds on the foundation of the Minimal template by showing one way that the hamburger control can be used.

The approach taken is to create a frame consisting of a ModalDialog that then shows the HamburgerMenu control alongside the current page that the user has navigated to. The frame is created with the following code in App.xaml.cs:

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 Views.Shell(nav),
        ModalContent = new Views.Busy(),
    };
}

This is executed in OnInitializeAsync and a more detailed explanation can be found in Implementing a shell. This approach ensures that the HamburgerMenu is displayed on every page without the developer needing to add it explicitly to every page.

If you are seeing squiggly lines after creating a project with this template, please follow the instructions to fix missing assemblies.

Do you have technical questions you want to ask the community? Use the Template10 tag on StackOverflow. http://stackoverflow.com/questions/tagged/template10

Clone this wiki locally