我有一个ListBox绑定到CollectionViewSource,文本框帮助我过滤掉了这个集合。但是,ListBox会自动选择第一个项目。如何防止自动选择发生?
代码:
<CollectionViewSource x:Key="caseCollection" Source="{Binding Cases}"></CollectionViewSource>
<StackPanel Orientation="Vertical" Background="White" Height="50">
<sdk:Label Name="lblWat">Enter a case</sdk:Label>
<TextBox Width="150" Height="23" x:Name="caseSearch" TextChanged="caseSearch_TextChanged" />
</StackPanel>
<ListBox ItemsSource="{Binding Source={StaticResource caseCollection}}" BorderThickness="0" BorderBrush="Transparent"
ItemContainerStyle="{StaticResource AdminListBoxItemStyle}"
SelectedItem="{Binding SelectedCase, Mode=TwoWay}" x:Name="lstCases"
SelectionMode="Single">