TextBlock使用EventTrigger触发命令,只能使用MouseLeftButtonDown或者MouseLeftButtonUp触发,要实现鼠标双击触发命令,可以使用InputBinding,具体代码如下

<TextBlock>
    <TextBlock.InputBinding>
            <MouseBinding MouseAction="LeftDoubleClick" 
                                  Command="{Binding DoubleClickCommand}"
                                  CommandParameter="{Binding }"/>
     </TextBlock.InputBinding>
</TextBlock>    

 

相关文章:

  • 2021-08-29
  • 2022-12-23
  • 2022-12-23
  • 2021-08-30
  • 2021-12-09
  • 2021-07-12
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-13
  • 2021-11-02
  • 2021-09-03
相关资源
相似解决方案