✅ how can i bind command to listboxitem's mousedoubleclick event in a datatemplate
i have this code
4 Replies
a
if you need to access the ListBoxItem directly for whatever reason, you need ListBox.ItemContainerStyle or ListBox.ItemContainerTemplate
for this, just accessing the TextBlock should be fine
and you need the Xaml Behaviors library
assuming "DoubleClick" is an event that exists
and that your command doesn't have CanExecute logic
actually, now I can't remember for sure if InvokeCommandAction will do a CanExecute check or not
point being, if the behavior of any of the above doesn't work for you, you'll have to subclass and implement your own TriggerBase<T>, TriggerAction<T>, or Behavior<T>
all of which are quite straightforward
or just do it all in codebehind
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.alrigjt thank you