I've changed it to use MouseDown instead of MouseClick.
One difference is that, for example, a click-and-drag on a scrollbar releasing the button on the empty area would also trigger a deselection, which is unintended in this case. This is because the mouse Location for the MouseClick event is determined at the 'mouse up'.