2017-05-01 253 views
0

可以做到這一點嗎?當發生驗證錯誤時,我想設置IsMouseOver。觸發器觸發器

<Style x:Key="textBoxInError" 
     TargetType="{x:Type TextBox}"> 
    <Style.Triggers> 
     <Trigger Property="Validation.HasError" 
       Value="true"> 
      <Setter Property="ToolTip" 
        Value="{Binding RelativeSource={x:Static RelativeSource.Self}, 
          Path=(Validation.Errors)[0].ErrorContent}" /> 
      <Setter Property="BorderThickness" 
        Value="3" /> 
      <Setter Property="BorderBrush" 
        Value="Red" /> 
      <Trigger Property="IsMouseOver" 
        Value="True"> 
       <Setter Property="BorderBrush" 
         Value="Red" /> 
      </Trigger> 
     </Trigger> 
    </Style.Triggers> 
</Style> 

回答

0

MultiTrigger可以包含多個條件。