在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>
编辑:现在的代码是正确的!
原文地址:https://www.jb51.cc/windows/371373.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。