如何在Windows Phone 8.1中添加AppBar [英] How can i add AppBar in Windows Phone 8.1

查看:99
本文介绍了如何在Windows Phone 8.1中添加AppBar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Windows Phone 8中,非常容易添加和管理应用程序栏,但是现在我测试新的Windows Phone 8.1 SDK来构建具有新地理围栏功能的项目,但是我不知道如何在其中添加应用程序栏该应用程序.

In windows phone 8, its very easy to add an App Bar and manage it, but now i test new windows phone 8.1 SDK to build a project with new Geofencing feature but i don't know how to add an App Bar in the App.

推荐答案

在Windows Phone 8.1中,我们可以使用BottomAppBar添加应用栏.通常,我们使用CommandBar创建基本的BottomAppBar. CommandBar包含两个集合:PrimaryCommandsSecondaryCommands,与Windows Phone 8中的shell:ApplicationBar.Buttonsshell:ApplicationBar.MenuItems相似.

In Windows Phone 8.1, We can use BottomAppBar to add App Bar. Usually we use CommandBar to create basic BottomAppBar. CommandBar contains two collection: PrimaryCommands and SecondaryCommands, It's similar with shell:ApplicationBar.Buttons and shell:ApplicationBar.MenuItems in Windows Phone 8.

请阅读此演示,我们创建一个带有两个按钮的CommandBar:ZoomOut和ZoomIn,以及两个menuItem:Test01和Test02:

Read this demo please, we create a CommandBar with two buttons: ZoomOut and ZoomIn, and two menuItem:Test01 and 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>

现在代码正确了!

这篇关于如何在Windows Phone 8.1中添加AppBar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆