ListBoxI 在xaml里只能添加PreviewMouseDown事件和SelectedChange事件,没有ListBoxItem点击事件,可以通过下面的方式添加点击事件
this.stencilListBox.AddHandler(UIElement.MouseDownEvent,
new MouseButtonEventHandler(StencilMouseDown), true);
参考:
ListBoxI 在xaml里只能添加PreviewMouseDown事件和SelectedChange事件,没有ListBoxItem点击事件,可以通过下面的方式添加点击事件
this.stencilListBox.AddHandler(UIElement.MouseDownEvent,
new MouseButtonEventHandler(StencilMouseDown), true);