在 windows phone 8 中,添加应用栏并对其进行管理非常容易,但现在我测试了新的 windows phone 8.1 SDK 以构建具有新地理围栏功能的项目,但我不知道如何在应用中添加应用栏。
最佳答案
在 Windows Phone 8.1 中,我们可以使用 BottomAppBar
添加应用程序栏。通常我们使用 CommandBar
创建基本的BottomAppBar。 CommandBar 包含两个集合:PrimaryCommands
和 SecondaryCommands
, 类似 shell:ApplicationBar.Buttons
和 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>
编辑:现在代码是正确的!
关于.net - 如何在 Windows Phone 8.1 中添加 AppBar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23529527/