问题
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>
回答1:
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)
来源:https://stackoverflow.com/questions/7341711/how-do-wpf-control-template-triggers-work