I have a wpf listbox with a custom item template which contains a rectangle. The each item in the listbox can be selected (only one at a time). I w
listbox
To assure that only one item is selected put this in the listbox:
SelectionMode="Single"
then for the unselect when clicking somewhere, you can try to check this events
PreviewMouseLeftButtonUp LostFocus()
Regards,