下面的代码更改所有状态的背景。如何仅在IsMouseOver和DataTrigger都为true时才将背景更改为蓝色?
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" TargetName="Target1" Value="Red" />
</Trigger>
<DataTrigger Binding = "{Binding ElementName = Import, Path = IsEnabled}" Value="true">
<Setter Property="Background" TargetName="Target1" Value="Blue" />
</DataTrigger>
</ControlTemplate.Triggers>
1条答案
按热度按时间iq0todco1#
你可以做一个
MultiDataTrigger
,比如: