[UWP] CommandBarOverflowPresenter实际显示的是什么? [英] [UWP] What the CommandBarOverflowPresenter actually shows?

查看:64
本文介绍了[UWP] CommandBarOverflowPresenter实际显示的是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

它们不是溢出ViewState中的AppBarButtons。更改溢出状态不会对显示的项目执行任何操作。

They are not AppBarButtons in Overflow ViewState. Changing the Overflow State does nothing to the items presented.

此外,应用以下全局样式:

Also, applying the following global style:

<Style TargetType="AppBarButton">
    <Setter Property="Foreground" Value="Red" />
</Style>


不会将项目的前景更改为红色。但它可以更改命令栏中的按钮。

Does not change the foreground of the items to red. But it works fine to change the buttons in the commandbar.

推荐答案

Hello Caio,

Hello Caio,

我认为您需要阅读
CommandBarOverflowPresenter class

您通常不会在XAML中为 CommandBarOverflowPresenter 声明对象元素。没有属性可以在XAML语法中设置
CommandBarOverflowPresenter ,并且没有理由声明
CommandBarOverflowPresenter  作为资源。

You don't typically declare object elements for CommandBarOverflowPresenter in XAML. There are no properties that a CommandBarOverflowPresenter can set in XAML syntax and there's no reason to declare a CommandBarOverflowPresenter  as a resource.

CommandBarOverflowPresenter 类的主要目的是成为

SecondaryCommands

CommandBar
。你扩展 通过设置
CommandBarOverflowPresenterStyle
属性。

Style
你 声明填充 CommandBarOverflowPresenterStyle 属性必须指定
TargetType =" CommandBarOverflowPresenter" 。可以设置样式的属性是基础

ItemsControl
类或
控制
类,例如
FontSize

填充
或基本元素属性如
FrameworkElement.Margin
CommandBarOverflowPresenter 类继承。

The main purpose of the CommandBarOverflowPresenter class is to be the default internal presenter for the SecondaryCommands value of a CommandBar. You extend  presentation behavior of the CommandBarOverflowPresenter by setting a value for the CommandBarOverflowPresenterStyle property of the CommandBar. The Style you  declare that fills the CommandBarOverflowPresenterStyle property must specify TargetType="CommandBarOverflowPresenter". The properties that can be styled are the dependency properties of the base ItemsControl class or Control class, such as FontSize or Padding, or base element properties such as FrameworkElement.Margin that the CommandBarOverflowPresenter class inherits.

首先,对于您的问题, CommandBarOverflowPresenter 适用于

SecondaryCommands
CommandBar的值。

First, for your question, the CommandBarOverflowPresenter is for the SecondaryCommands value of CommandBar.

其次,我们需要设置TargetType。

Second, we need to set the TargetType.

祝你好运,

Barry


这篇关于[UWP] CommandBarOverflowPresenter实际显示的是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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