When pressing a button I select a user control and set ItemsSource to null
CategoriesListBox.ItemsSource = null;
As soon as this code runs, a SelectionChanged event fires
private void CategoriesListBox_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
{}
-
<Custom:SurfaceListBox
x:Name="CategoriesListBox"
ManipulationDelta="CategoriesListBox_ManipulationDelta"
IsManipulationEnabled="True"
SelectionChanged="CategoriesListBox_SelectionChanged"
ItemTemplate="{DynamicResource CategoriesUnselectedDataTemplate}"
SelectionMode="Single">
</Custom:SurfaceListBox>
I need to avoid this and have not the _SelectionChanged fired.
Any idea how to solve this?