How to change ListBox and ListView selection rule as same way as WinForms?
In WPF, if already an item is selected in ListBox/ListView, even an empty area of the List is clicked, the selection is still remained. In WinForm/MFC, the selection is unselected when an empty area is clicked.
That is very useful especially for implementation-wise.
For example, when user double-clicked an item in ListBox, one of preferable behaviors is followings: -If user double-clicked an item, it is shortcut to modify the item, so configuration dialog will be opened. -If user double-clicked an empty are, it is shortcut to add an new item, so file selection dialog will be opened.
To implement this behavior, using hit-test to find clicked item would be preferable. But, since hit-test in WPF is not so easy to use comparing with WinForm, the easiest way is just checking selected item whenever user double-clicked the List.
It worked the application is made by WinForm/MFC, but not WPF because of the behavior difference of list item selection.
Is there any way to change list item selection to same way as WinForm/MFC? Or, should I choose different way to implement above behavior?