gpt4 book ai didi

wpf - 绑定(bind) ="{Binding (0)}"是什么意思?

转载 作者:行者123 更新时间:2023-12-04 07:54:05 27 4
gpt4 key购买 nike

我找到了这个:

<DataTrigger Value="True" Binding="{Binding (0)}">

触发 RibbonMenuButton模板。这是什么意思?我试过谷歌,但一无所获。

UPD 更多代码:
<ControlTemplate x:Key="RibbonMenuButtonControlTemplate1" TargetType="{x:Type RibbonMenuButton}">
...
<DataTrigger Binding="{Binding (0)}" Value="True">
<Setter Property="TextElement.Foreground" TargetName="MainGrid" Value="{DynamicResource {x:Static SystemColors.MenuTextBrushKey}}"/>
<Setter Property="PathFill" TargetName="TwoLineText" Value="{DynamicResource {x:Static SystemColors.MenuTextBrushKey}}"/>
<Setter Property="CornerRadius" TargetName="OuterBorder" Value="0"/>
<Setter Property="Background" TargetName="OuterBorder" Value="Transparent"/>
<Setter Property="BorderBrush" TargetName="OuterBorder" Value="Transparent"/>
</DataTrigger>
...

此代码在按下 RibbonMenuButton 上的“编辑模板”按钮后在 Blend 中创建控制。

最佳答案

它看起来像一个错误。据我所知,在WPF中不能Binding这种类型的。下面列出不足之处,请注意第一段,引自 connect.microsoft.com (archive):

I'm trying to style the ribbon control (System.Windows.Controls.Ribbon) and I keep running into problems.

  • If I use Blend or another tool to copy the default template of the Ribbon, the RibbonGroup, the RibbonTab, etc. these templates have errors. There are Bindings like {Binding (0)}.

  • I cannot change the height of the ribbon control.

  • It's not possible to change the template of the RibbonGroup, to change the appearance of the separator and to place the header in the top left corner of the group.

  • It's not possible to add a label to the ApplicationMenuButton. Furthermore this button has a fixed width.

  • I can't manage to remove the borders at the bottom of the ribbon control.



据我了解,没有修补程序。

关于wpf - 绑定(bind) ="{Binding (0)}"是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21879168/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com