在Windows Phone 8中,添加应用程序栏并管理它非常容易,但现在我测试新的Windows Phone 8.1 SDK来构建具有新地理围栏功能的项目,但我不知道如何在应用程序中添加应用程序栏。
在Windows Phone 8.1中,我们可以使用BottomAppBar
添加应用栏。通常我们使用CommandBar
创建基本的 BottomAppBar。 CommandBar包含两个集合:PrimaryCommands
and SecondaryCommands
, 类似于shell:ApplicationBar.Buttons
and shell:ApplicationBar.MenuItems
在 Windows Phone 8 中。
请阅读这个演示,我们创建一个带有两个按钮的 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>
编辑:现在代码是正确的!
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)