M4: 使用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效果。

M4: 使用CommandBar的更多相关文章
- PHP扩展-如何使用文件config.m4
config.m4文件用于指定正在开发的扩展在类unix系统下构建时支持的选项,指定此扩展需要哪些库以及哪些源文件:使用 GNU autoconf 语法编写.注意需要重新执行phpize,config ...
- 关于 m4 文本处理引擎
使用 m4 开源项目还是挺多的,之前看到都有的怕怕的,选择自动略过.今天鼓起勇气来学习一波. 首先 m4 processor 是一个“宏定义”处理器,也就是说,他是一个纯粹的文本处理器,干些管理模板, ...
- 安装openssl 扩展的时候出现Cannot find config.m4. Make sure that you run '/usr/local/php/bin/phpize' in the top level source directory of the module的解决方法
进入php源码包目录:cd /usr/local/php-5.6.25/ext/openssl 执行命令: cp ./config0.m4 ./config.m4 即可
- phpize建立php扩展 Cannot find config.m4
centos php 安装 memcache 扩展的时候 爆 Cannot find config.m4 错误 解决方案参考以下文章 参考文章 http://blog.csdn.net/wgl ...
- 手动安装m4, autoconf, automake, libtool
转自http://ruby-china.org/topics/2434 系列文章原载于自己的博客,TOPI.CO (http://topi.co) ,某天不小心就push错啦,懒得从头再来,上传到Ru ...
- Windows 8.1 新增控件之 CommandBar
上一篇为大家介绍了AppBar 的相关内容,本篇继续介绍CommandBar 的使用方法.与AppBar 相比而言,CommandBar 在开发使用方面较为单一,在按键布局上分为主控区(Primary ...
- GNU M4 - GNU Project - 免费软件基金会(FSF)
-------------------------------------------------------------------------------------- GNU M4介绍: GNU ...
- IBM X3650 M4服务器安装centos找不到硬盘的解决方法
IBM X3650 M4是IBM新的2U的服务器,IBM服务器以高稳定性和卓越的性能一直领先其他的服务器品牌成为全球第一.但是我们在用IBM的最新版9.4引导盘引导的时候,里面选项只有windows ...
- 重新想象 Windows 8.1 Store Apps (72) - 新增控件: AppBar, CommandBar
[源码下载] 重新想象 Windows 8.1 Store Apps (72) - 新增控件: AppBar, CommandBar 作者:webabcd 介绍重新想象 Windows 8.1 Sto ...
随机推荐
- iptables交互配置shell脚本
#!/bin/bash while true do clear echo "———————-menu————————" echo -e "\033[49;32;1m(1) ...
- 关于SQLite作业
--查询Student表中的所有记录的Sname.Ssex和Class列.SELECT sname,ssex,class from Student --查询教师所有的单位即不重复的Depart列.SE ...
- 14.KVM安装之脚本和镜像目录树准备
1.php脚本需要先安装PHP环境,Apache服务器必须支持PHP $ yum install -y php #安装PHP $ php -v #查看是 ...
- Python学习笔记(2)
变量 变量名就像我们现实社会的名字,把一个值赋值给一个名字时,它会存储在存储中,称之为变量(Variable),在大多数语言中,都把这种行为称为“给变量赋值”或“把值存储在变量中”. 而Python与 ...
- jsp标签精华(持续更新中)
<%@ taglib uri="/struts-tags" prefix="s" %> <%@ taglib uri="http:/ ...
- git ignore 添加忽略文件不生效解决办法
在git中如果想忽略掉某个文件,不让这个文件提交到版本库中,可以使用修改根目录中 .gitignore 文件的方法(如无,则需自己手工建立此文件).这个文件每一行保存了一个匹配的规则例如: /targ ...
- 用cxf开发restful风格的WebService
我们都知道cxf还可以开发restful风格的webService,下面是利用maven+spring4+cxf搭建webService服务端和客户端Demo 1.pom.xml <projec ...
- (40) Aeroo 服务安装
服务器 Odoo 8.0 操作系统: Ubuntu trusty14.04 说明:安装aeroo 要的要两个服务 areoo-docs 和 soffice 这里设定两个端口 8989 和 8100 = ...
- 编程之美--2. Trie树 (Trie图)
#1014 : Trie树 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 小Hi和小Ho是一对好朋友,出生在信息化社会的他们对编程产生了莫大的兴趣,他们约定好互相帮助, ...
- 初学者:JSP登陆界面
学生登陆查询系统 1 程序的主要功能及特点 实现一个登录界面的基本功能,具体要求: 登录界面login.jsp含有表单,用户能够输入用户名和密码,并提交表单给verify.jsp. Verify.js ...