M4: 使用CommandBar
2015-11-24 17:24
375 查看
本小节将介绍如何使用
在
打开Card程序, 在
在CommandBar中加入第一个
同样加入其它三个
加入二级菜单项目。
在第二和第三个AppBarButton之间加入
然后,定义abtnGetWishes的单击事件为
修改后代码如下:
运行程序, 查看新添加CommandBar效果。
CommandBar, CommandBar分为
PrimaryCommands和
SecondaryCommands,在
PrimaryCommands中不要放置多于四个按钮。然后将不常使用的命令放到
SecondaryCommands中。
在
MainPage.xaml页面, 添加
Page.BottomAppBar, 在CommandBar中新添加四个
AppBarButton。在CommandBar.SecondaryCommands中添加一个
Menu Item。
打开Card程序, 在
MainPage.xaml页面, 在
</Page>之前,新添加
Page.BottomAppBar控件。 在Page.BottomAppBar控件中, 新添加
CommandBar控件, 修改后代码如下:
<Page.BottomAppBar> <CommandBar> </CommandBar> </Page.BottomAppBar> </Page>
在CommandBar中加入第一个
AppBarButton Control, 命名为abtnGetWishes, 设置其
Icon属性,
Label属性。
<AppBarButton x:Name="abtnGetWishes" Icon="Play" Label="Wishes" />
同样加入其它三个
AppBarButton Control, 并设置相应属性。
<AppBarButton x:Name="abtnGetWishes" Icon="Play" Label="Wishes" /><AppBarButton x:Name="abtnSendFriend" Icon="Send" Label="Wishes" />
<AppBarButton x:Name="abtnOpenFile" Icon="Pictures" Label="Wishes" />
<AppBarButton x:Name="abtnOpenCamera" Icon="Camera" Label="Wishes" />
加入二级菜单项目。
<CommandBar.SecondaryCommands> <AppBarButton x:Name="abtnLike" Icon="Like" Label="Like" /> </CommandBar.SecondaryCommands>
在第二和第三个AppBarButton之间加入
AppBarSeparator,将命令分组。
<AppBarSeparator />
然后,定义abtnGetWishes的单击事件为
GetMessage_Click, 定义abtnSendFriend的单击事件为
SendMail_Click。
修改后代码如下:
<Page.BottomAppBar>
<CommandBar>
<AppBarButton x:Name="abtnGetWishes" Icon="Play" Label="Wishes" Click="GetMessage_Click"/>
<AppBarButton x:Name="abtnSendFriend" Icon="Send" Label="Send" Click="SendMail_Click"/>
<AppBarSeparator /><AppBarButton x:Name="abtnOpenFile" Icon="Pictures" Label="Open" />
<AppBarButton x:Name="abtnOpenCamera" Icon="Camera" Label="Camera" />
<CommandBar.SecondaryCommands> <AppBarButton x:Name="abtnLike" Icon="Like" Label="Like" /> </CommandBar.SecondaryCommands></CommandBar>
</Page.BottomAppBar>
运行程序, 查看新添加CommandBar效果。
相关文章推荐
- 性能调优之MYSQL高并发优化下
- SQL中的IF ELSE(CASE语句的使用)
- 在ubuntu上安装nginx
- Xpose之应用,微信数据修改
- Quartz
- github上的安卓开源库汇总
- Android高手应该精通哪些内容?
- M3: 发送邮件附件(2)
- sql: sybase与oracle中insert into select和select into的用法
- 性能调优之MYSQL高并发优化
- jquery视频展示 图片轮播
- C语言实现链表之双向链表(七)尾结点后插入结点
- 一台机器上运行多个ActiveMq
- textview 前面有标签,textview里面关键字标红,有小表情
- [Mysql数据库] 每天自动备份mysql脚本
- 总结SPM,ScSPM,LLC
- matlab quadprog函数 二次规划的matlab解法
- 利用第三方开源框架 PullToRefreshListView 实现下拉刷新
- 为何gpio_to_irq不能静态使用?【转】
- linux下解压.zip压缩包出现乱码的问题解决