wpf,对于列表模板里点击事件的2种写法的差异

时间:2021-08-06 12:03:56   收藏:0   阅读:19
 1 <i:Interaction.Triggers>
 2     <i:EventTrigger EventName="MouseDown">
 3         <i:InvokeCommandAction Command="{Binding LocatedCommand}" />
 4     </i:EventTrigger>
 5     <i:EventTrigger EventName="MouseDoubleClick">
 6         <i:InvokeCommandAction Command="{Binding PersonnelDetailShowCommand}" />
 7     </i:EventTrigger>
 8 </i:Interaction.Triggers>
 9 <!--下面这个写法会阻止消息的传递,引发界面上潜在的问题-->
10 <!--<Grid.InputBindings>
11     <MouseBinding Command="{Binding PersonnelDetailShowCommand}" MouseAction="LeftDoubleClick" />
12     <MouseBinding Command="{Binding LocatedCommand}" MouseAction="LeftClick" />
13 </Grid.InputBindings>-->

尽量使用第一种写法

原文:https://www.cnblogs.com/zsx-blog/p/15107605.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!