Windows Phone 8.1 AppBarButton 模板不可编辑 [英] Windows Phone 8.1 AppBarButton Template not editable

查看:30
本文介绍了Windows Phone 8.1 AppBarButton 模板不可编辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法在 Windows Phone 8.1 项目中重新定义 BottomAppBar 内的 AppBarButton 模板.

I am not able to redefine the Template of an AppBarButton inside BottomAppBar in a Windows Phone 8.1 project.

在 Visual Studio XAML 设计器中它会发生变化(它显示按钮 2"文本),但是当我将它部署到手机或模拟器时,会应用默认模板.

In Visual Studio XAML designer it changes (it shows "button 2" text), but when I deploy it to the phone or to the emulator, the default template is applied.

我尝试右键单击控件,编辑模板"、编辑副本...",但它不可用.有没有可能,重新定义这个模板?

I tried to right click the control, "Edit template", "Edit a copy...", but it's not available. Is it possible, to redefine this template?

我的 XAML 代码(只是一个非常简单的例子):

My XAML code (just a very simplified example):

<Page.BottomAppBar>
    <CommandBar>
        <CommandBar.SecondaryCommands>
            <AppBarButton
                Label="button">
                <AppBarButton.Template>
                    <ControlTemplate>
                        <TextBlock
                            Text="button 2" />
                    </ControlTemplate>
                </AppBarButton.Template>
            </AppBarButton>
        </CommandBar.SecondaryCommands>
    </CommandBar>
</Page.BottomAppBar>

我安装了带有 Visual Studio Community 2013 Update 4 的 Windows 8.1 Pro.

I have Windows 8.1 Pro with Visual Studio Community 2013 Update 4 installed.

推荐答案

不,不能在 Windows Phone 8.1 上自定义除前景色和背景色之外的应用栏.在 Windows Phone 上,应用栏是系统 UI,而不是应用即 UI.

No, it is not possible to customize the app bar on Windows Phone 8.1 beyond the foreground and background colors. On Windows Phone the app bar is system UI rather than app as UI.

如果您想自定义应用栏按钮,您可以将它们放在停靠在页面底部的自定义面板中,而不是放在 Page.BottomAppBar 中

If you want to customize your app bar buttons you can put them in a custom panel docked at the bottom of the page instead of in a Page.BottomAppBar

这篇关于Windows Phone 8.1 AppBarButton 模板不可编辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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