<TextBox Text="" x:Name="txtName"/>
<Button Content="Click">
<Button.Style>
<Style TargetType="Button">
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=input, Path=Text}" Value="1">
<Setter Property="Mouse.Leave" Value="{Binding OnAdd}"></Setter>
</DataTrigger>
<DataTrigger Binding="{Binding ElementName=input, Path=Text}" Value="2">
<Setter Property="Mouse.Leave" Value="{Binding OnAddMove}"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
Button Click(Property = Command)是由txtName工作的; 但MouseLeave不起作用