1
我有一个ListBox
与ItemsSource
绑定。如果有人选择ListBoxItem
并按Enter键,则应该执行命令。我怎么能这样做?我有ItemContainerStyle
为ListBox
,我找不到通过Style设置InputBindings
的方法。如何为DataBound ListBox做InputBindings?
任何想法?
我有一个ListBox
与ItemsSource
绑定。如果有人选择ListBoxItem
并按Enter键,则应该执行命令。我怎么能这样做?我有ItemContainerStyle
为ListBox
,我找不到通过Style设置InputBindings
的方法。如何为DataBound ListBox做InputBindings?
任何想法?
您可以创建一个设置绑定的附加助手属性here would be an example,然后您可以在该样式中设置该属性。