本小节将介绍如何使用CommandBar, CommandBar分为PrimaryCommandsSecondaryCommands,在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的更多相关文章

  1. PHP扩展-如何使用文件config.m4

    config.m4文件用于指定正在开发的扩展在类unix系统下构建时支持的选项,指定此扩展需要哪些库以及哪些源文件:使用 GNU autoconf 语法编写.注意需要重新执行phpize,config ...

  2. 关于 m4 文本处理引擎

    使用 m4 开源项目还是挺多的,之前看到都有的怕怕的,选择自动略过.今天鼓起勇气来学习一波. 首先 m4 processor 是一个“宏定义”处理器,也就是说,他是一个纯粹的文本处理器,干些管理模板, ...

  3. 安装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 即可

  4. phpize建立php扩展 Cannot find config.m4

    centos  php  安装 memcache 扩展的时候   爆 Cannot find config.m4 错误 解决方案参考以下文章 参考文章 http://blog.csdn.net/wgl ...

  5. 手动安装m4, autoconf, automake, libtool

    转自http://ruby-china.org/topics/2434 系列文章原载于自己的博客,TOPI.CO (http://topi.co) ,某天不小心就push错啦,懒得从头再来,上传到Ru ...

  6. Windows 8.1 新增控件之 CommandBar

    上一篇为大家介绍了AppBar 的相关内容,本篇继续介绍CommandBar 的使用方法.与AppBar 相比而言,CommandBar 在开发使用方面较为单一,在按键布局上分为主控区(Primary ...

  7. GNU M4 - GNU Project - 免费软件基金会(FSF)

    -------------------------------------------------------------------------------------- GNU M4介绍: GNU ...

  8. IBM X3650 M4服务器安装centos找不到硬盘的解决方法

    IBM X3650 M4是IBM新的2U的服务器,IBM服务器以高稳定性和卓越的性能一直领先其他的服务器品牌成为全球第一.但是我们在用IBM的最新版9.4引导盘引导的时候,里面选项只有windows ...

  9. 重新想象 Windows 8.1 Store Apps (72) - 新增控件: AppBar, CommandBar

    [源码下载] 重新想象 Windows 8.1 Store Apps (72) - 新增控件: AppBar, CommandBar 作者:webabcd 介绍重新想象 Windows 8.1 Sto ...

随机推荐

  1. Spring并发访问的线程安全性问题

    Spring并发访问的线程安全性问题 http://windows9834.blog.163.com/blog/static/27345004201391045539953/ 由于Spring MVC ...

  2. Spring中处理Post方法中文乱码

    在Web.xml中配置: <!-- 注册Spring提供的处理Post请求的乱码问题 --> <filter> <filter-name>CharacterEnco ...

  3. query判断值是否为空,针对前台提交数据的校验

    1.<input type="hidden" id="key" name="key" value="123"> ...

  4. .NET IL学习笔记(一)

    参考资料: 1. <.NET IL Assembler> 2. NGEN代码产生器 3. NGEN的使用 4. IL编辑器下载 5. IL编辑器的使用 知识点: ● Common Lang ...

  5. C#相等性比较

    本文阐述C#中相等性比较,其中主要集中在下面两个方面 ==和!=运算符,什么时候它们可以用于相等性比较,什么时候它们不适用,如果不使用,那么它们的替代方式是什么? 什么时候,需要自定一个类型的相等性比 ...

  6. TCP/IP知识点汇总

    1.HUB.Switch.Router在OSI模型中分别是第几层设备,各层的名称是什么? 2.TCP/IP 协议栈及 OSI 参考模型详解

  7. Android Fragment是什么

    Fragment是Activity中用户界面的一个行为或者一个部分.你可以在一个单独的Activity上把多个Fragment组合成一个多区域的UI,并且可以在多个Activity中使用.你可以认为F ...

  8. CSS 3中边框怎么用

    (1)设置边框图片的来源 图片边框默认只在四个顶点显示 none: 无背景图片; border-image-source: url('borderImage.png'); (2)边框图片的分割 将图片 ...

  9. Authentication和Authorization的区别

    搞不太清楚Authentication和Authorization的区别,在网上搜了一下,lucky16的一篇文章讲的通俗,看了就懂,记录下来: 你要登机,你需要出示你的身份证和机票,身份证是为了证明 ...

  10. 如何使CSS3中的animation动画当每滑到一屏时每次都运行

    这个我还没用过,但感觉以后会用到,就随手摘抄一下啦<div id="a1"></div> <div id="a2">< ...