Answer the question
In order to leave comments, you need to log in
How to filter a double click on a ListView with only the left button in WPF?
Good time of the day.
I'm trying to filter double click on ListVIew with left mouse button only:
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseDoubleClick">
<i:InvokeCommandAction Command="{Binding Edit, Mode=OneWay}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
public ICommand Edit
{
get
{
return new DelegateCommand(o =>
{
ApplicationController.EditReminder(SelectedReminder);
SaveReminders();
});
}
}
Answer the question
In order to leave comments, you need to log in
You can go in different ways:
1. Use InputBinding , namely MouseBinding . Here LeftDoubleClick is one of the options for tracked actions, you can see the entire list here
2. Use CallMethodAction instead of InvokeCommandAction , then you can take into account the event arguments.
The method signature must be exactly the same as if you were handling the event in the View part.
3. Look for an implementation (or write it yourself) EventToCommand where the PassEventArgsToCommand method will be (with the correct implementation)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question