How to add AppBar

How to add custom AppBar

Like Other contols, AppBar is also under nmaespace of "Windows.UI.Xaml.Controls", and it just a simple ContentControl.

The member of AppBar is also very simple, IsOpen and IsStick represents whether open or not and whether  not hide automatical. And we can use events Opened and Closed to reopresents open and hide them. 

Now we can through Page.TopAppBar and BottomAppBar to set top and bottom appbar for Metro Application. Following are small code snippet creates a samll demo:

<Page.BottomAppBar>
        <AppBar IsOpen = "True" IsSticky = "True" x:Name="bottomAppBar" Closed="Closedevent" Padding="10,0,10,0">
            <Grid>
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                    <Button Style="{StaticResource AddAppBarButtonStyle}" Click="AddButton_Click"/>
                    <Button Style="{StaticResource EditAppBarButtonStyle}" Click="EditButton_Click" />
                </StackPanel>
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                    <Button Style="{StaticResource HelpAppBarButtonStyle}" Click="HelpButton_Click" />
                </StackPanel>
            </Grid>
        </AppBar>
    </Page.BottomAppBar>

 And Please attention: no matter when you set the value of IsStrick is True,When you right click on Metro App, AppBar is disappeared.

原文地址:https://www.cnblogs.com/Blackeye286/p/2853213.html