Why does the WPF listbox change selection on mouse button down rather than button up?
问题 I had never noticed this before, but the WPF ListBox seems to change its SelectedItem when the Mouse is down, but has not yet been released. As a quick example, just create a simple ListBox with several ListBoxItems, like so: <ListBox> <ListBoxItem>Hello</ListBoxItem> <ListBoxItem>World</ListBoxItem> <ListBoxItem>ListBox</ListBoxItem> <ListBoxItem>Test</ListBoxItem> </ListBox> fire up your application, press the mouse button (don't release it!) and move the mouse around. The SelectedItem will