.net – 如何在Windows Phone 8.1中添加AppBar

在Windows Phone 8中,它很容易添加一个App Bar并进行管理,但是现在我测试了新的Windows Phone 8.1 SDK来构建一个具有新的Geofencing功能的项目,但是我不知道如何在App中添加一个App Bar.
在Windows Phone 8.1中,我们可以使用BottomAppBar添加App Bar.通常我们使用CommandBar创建基本的BottomAppBar. CommandBar包含两个集合:PrimaryCommands和SecondaryCommands,与Windows Phone 8中的Shell:ApplicationBar.Buttons和shell:ApplicationBar.MenuItems类似.

请阅读本演示,我们创建一个带有两个按钮的CommandBar:ZoomOut和ZoomIn,以及两个menuItem:Test01和Test02:

<Page.BottomAppBar>
    <CommandBar Issticky="True" x:Name="appBar">
        <CommandBar.PrimaryCommands>
            <AppBarButton Icon="ZoomOut" IsCompact="False" Label="ZoomOut"/>
            <AppBarButton Icon="ZoomIn" IsCompact="False" Label="ZoomIn"/>
        </CommandBar.PrimaryCommands>
        <CommandBar.SecondaryCommands>
            <AppBarButton Label="Test01"/>
            <AppBarButton Label="Test02"/>
        </CommandBar.SecondaryCommands>
    </CommandBar>
</Page.BottomAppBar>

编辑:现在的代码是正确的!

相关文章

Windows2012R2备用域控搭建 前置操作 域控主域控的主dns:自...
主域控角色迁移和夺取(转载) 转载自:http://yupeizhi.blo...
Windows2012R2 NTP时间同步 Windows2012R2里没有了internet时...
Windows注册表操作基础代码 Windows下对注册表进行操作使用的...
黑客常用WinAPI函数整理之前的博客写了很多关于Windows编程的...
一个简单的Windows Socket可复用框架说起网络编程,无非是建...