1
<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>

按钮 Click(Property=Command) 由 txtName 工作;但是 MouseLeave 不起作用

4

0 回答 0