wpf控件模板触发器如何工作?
我在 http://www.codeproject 中看到了选项卡控件的控件模板。 com/KB/WPF/WPFOutlookNavi.aspx
- 此属性是否会触发? (不是数据/事件触发器)
- 此触发器是否以这种方式工作 - 如果 TabStripPlacement 为“Bottom”...所有 Setter 都将被执行?
<ControlTemplate.Triggers>
<Trigger Property="TabStripPlacement" Value="Bottom">
<Setter Property="Grid.Row" TargetName="ContentPanel" Value="0" />
<Setter Property="Height" TargetName="RowDefinition0" Value="*" />
<Setter Property="Height" TargetName="RowDefinition1" Value="Auto" />
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="{DynamicResource
{x:Static SystemColors.GrayTextBrushKey}}" />
</Trigger>
</ControlTemplate.Triggers>
I have seen a control template for tab control...in http://www.codeproject.com/KB/WPF/WPFOutlookNavi.aspx
- Is this property triggers ? (Not data/event triggers)
- Is this trigger works this way - if TabStripPlacement is "Bottom"...all Setters will be executed ?
<ControlTemplate.Triggers>
<Trigger Property="TabStripPlacement" Value="Bottom">
<Setter Property="Grid.Row" TargetName="ContentPanel" Value="0" />
<Setter Property="Height" TargetName="RowDefinition0" Value="*" />
<Setter Property="Height" TargetName="RowDefinition1" Value="Auto" />
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="{DynamicResource
{x:Static SystemColors.GrayTextBrushKey}}" />
</Trigger>
</ControlTemplate.Triggers>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,是的,除了“执行”在这里可能是错误的词,更准确的是:当 TabStrinpPlacement 位于底部时,设置器处于活动状态。 (即,如果该值更改为其他值,则将再次使用以前的值,另请参阅:DP 优先级)
Yes and yes, except that "executed" may be the wrong word here, more accurate would be: While TabStrinpPlacement is Bottom, the setters are active. (i.e. if the value changes to something else the previous values will be used again, see also: DP Precedence)