How do wpf control template triggers work?
I have seen a control template for tab control...in http://www.codeproject.com/KB/WPF/WPFOutlookNavi开发者_JS百科.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>
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)
精彩评论