Why is selection behavior incorrect when I have the same object in a ListBox multiple times?
For compatibility with WPF, of course! 🙂 Due to the way ItemsControl is implemented, it is necessary for it to maintain a mapping from the objects it contains to the corresponding wrappers (i.e., ListBoxItems) that get created for them. This is handled by the ItemContainerGenerator.ContainerFromItem method on WPF and by ListBox.GetListBoxItemForObject on Silverlight – but the idea is the same. When the same object reference is added to the ListBox multiple times, this mapping breaks down because it isn’t prepared for a single object to map to multiple containers. As it happens, the WPF and Silverlight behaviors differ slightly here. Both seem wrong, but I’ll suggest that the Silverlight behavior is slightly less wrong.