gpt4 book ai didi

c# - 如何在 WPF 中释放鼠标左键时触发事件?

转载 作者:太空狗 更新时间:2023-10-29 22:30:59 24 4
gpt4 key购买 nike

我需要在松开鼠标左键时触发一个事件。我试过这个:

<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseClick" >
<i:InvokeCommandAction Command="{Binding OnBarGroupChangeCommand}" CommandParameter="{Binding ElementName=ReportsBarGroup, Path=Key}" />
</i:EventTrigger>
</i:Interaction.Triggers>

还有这个

        <igWPF:OutlookBarGroup.InputBindings>
<MouseBinding MouseAction="LeftClick"
Command="{Binding OnBarGroupChangeCommand}" CommandParameter="{Binding ElementName=ReportsBarGroup, Path=Key}"/>
</igWPF:OutlookBarGroup.InputBindings>

这些都有效。这两种情况的问题是当按钮被按下时事件会触发。我需要它只在按钮被释放时触发。 MouseBinding 似乎不支持这一点。有没有办法通过交互来做到这一点?处理这个问题的最佳方法是什么?谢谢。

最佳答案

尝试 EventTrigger 事件名称“MouseLeftButtonUp”。

关于c# - 如何在 WPF 中释放鼠标左键时触发事件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25435134/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com