Windows Phone 8.1 CommandBar 菜单栏

network | | 访问(57)
<Page.BottomAppBar>
    <CommandBar Opened="CommandBar_Opened" Closed="CommandBar_Closed">
        <AppBarButton Label="buy"  Icon="shop"/>
        <AppBarButton Label="BitmapIcon" Click="AppBarButton_Click">
            <AppBarButton.Icon>
                <BitmapIcon UriSource="ms-appx:///Assets/questionmark.png"/>
            </AppBarButton.Icon>
        </AppBarButton>
        <AppBarButton Label="FontIcon" Click="AppBarButton_Click">
            <AppBarButton.Icon>
                <FontIcon FontFamily="Candara" Glyph="&#x03A3;"/>
            </AppBarButton.Icon>
        </AppBarButton>
        <AppBarButton Label="PathIcon" Click="AppBarButton_Click">
            <AppBarButton.Icon>
                <PathIcon Data="F1 M 20,20L 24,10L 24,24L 5,24"/>
            </AppBarButton.Icon>
        </AppBarButton>
        <CommandBar.SecondaryCommands>
            <AppBarButton Label="about"  Click="AppBarButton_Click"/>
        </CommandBar.SecondaryCommands>
    </CommandBar>
</Page.BottomAppBar>
private void CommandBar_Opened(object sender, object e) 
{
    info.Text = "菜单栏打开了";
}

private void CommandBar_Closed(object sender, object e) 
{
    info.Text = "菜单栏关闭了";
}

private void AppBarButton_Click(object sender, RoutedEventArgs e) 
{
    info.Text = "单击了菜单栏:" + (sender as AppBarButton).Label;
}