1

I have a ListBox with ItemsSource bound. If anyone selects a ListBoxItem and presses Enter key, a command should be executed. How could I do this? I have ItemContainerStyle for ListBox and I cannot find a way to set InputBindings through Style.

Any ideas?

Toto
  • 89,455
  • 62
  • 89
  • 125
WPF Lover
  • 299
  • 6
  • 16

1 Answers1

0

You could create an attached helper property which sets the bindings, here would be an example, you then can set that property in the style.

Community
  • 1
  • 1
H.B.
  • 166,899
  • 29
  • 327
  • 400