Today I just came across a problem in ListBox, probably with all Selectors. When you bind a CollectionView object which has GroupDescriptions added as below, the first item of Selector will set to be selected by default without user interaction.

<CollectionViewSource x:Key="source" Source="{Binding}">
<CollectionViewSource.GroupDescriptions>
<PropertyGroupDescription PropertyName="Genre"/>
</CollectionViewSource.GroupDescriptions>
</CollectionViewSource>

The grouped source bound to ListBox in following way,

<ListBox ItemsSource="{Binding Source={StaticResource source}}"
DisplayMemberPath="Name">
<ListBox.GroupStyle>
<GroupStyle>
<GroupStyle.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}"/>
</DataTemplate>
</GroupStyle.HeaderTemplate>
</GroupStyle>
</ListBox.GroupStyle>
</ListBox>

In this case, the first item of ListBox will be selected by default without user interaction.

groupingdemo

This clearly seems to be an unwanted behavior, probably an issue. Josh Smith in his blog, explained a solution for this problem. But it is not so straightforward. Instead of that setting the IsSynchronizedWithCurrentItem to false will solve the problem.

<ListBox ItemsSource="{Binding Source={StaticResource source}}"
IsSynchronizedWithCurrentItem="False"
DisplayMemberPath="Name">
<ListBox.GroupStyle>
<GroupStyle>
<GroupStyle.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}"/>
</DataTemplate>
</GroupStyle.HeaderTemplate>
</GroupStyle>
</ListBox.GroupStyle>
</ListBox>