How do I create master pages?

Sep 24, 2013 at 12:30 PM
Hello,

If I create a page based on the ListPage.xaml template and want to use this as a common page but with different links, is it possible to do this without creating new ListPages.xaml each time?

For example, the code below has a link for settings/settings1/ListPageOption1/ContentPage.xaml, in this case ListPages.xaml has hardcoded links and source.

Say I now want to create settings/settings2/NewListPageOptions/NewContentPage.xaml is it possible to have a single generic ListPages.xaml page so I only need to create new content pages each time and define what's in ListPages.xaml content/source from MainWindow?

MainWindow.xaml
  Title="MainWindow" Height="700" Width="1050">

    <mui:ModernWindow.MenuLinkGroups>
        <mui:LinkGroup DisplayName="main" >
            <mui:LinkGroup.Links>
                <mui:Link DisplayName="mainlink1"  />
                <mui:Link DisplayName="mainlink2" />
                <mui:Link DisplayName="mainlink3" />
            </mui:LinkGroup.Links>
        </mui:LinkGroup>
        <mui:LinkGroup DisplayName="settings" >
            <mui:LinkGroup.Links>
                <mui:Link DisplayName="setting1" Source="/Pages/ListPage.xaml" />
                <mui:Link DisplayName="setting2" />
                <mui:Link DisplayName="setting3" />
            </mui:LinkGroup.Links>
        </mui:LinkGroup>        
    </mui:ModernWindow.MenuLinkGroups>
</mui:ModernWindow>
ListPage.xaml
    <Grid Style="{StaticResource ContentRoot}">
        <!-- TODO: set @SelectedSource -->
        <mui:ModernTab Layout="List">
            <mui:ModernTab.Links>
                <!-- TODO: set @Source -->
                <mui:Link DisplayName="ListPageOption1" Source="/Content/ContentPage.xaml"/>
                <mui:Link DisplayName="ListPageOption2" />
                <mui:Link DisplayName="ListPageOption3" />
            </mui:ModernTab.Links>
        </mui:ModernTab>
    </Grid>
ContentPage.xaml
    <Grid>
        <DockPanel  LastChildFill="True">
            <TextBlock Text="Content1" Style="{StaticResource Heading2}" DockPanel.Dock="Top" />
            <TextBlock Text="Content2" Style="{StaticResource Heading2}" DockPanel.Dock="Top" />
        </DockPanel>
    </Grid>