Running the following code will not remove the item from the list box (as it appears to the user)
lbxUserSecurityGroups.ItemsSource = _currentUserGroups;
_currentUserGroups.RemoveAt(0);
lbxUserSecurityGroups.ItemsSource = _currentUserGroups;
but this will:
lbxUserSecurityGroups.ItemsSource = _currentUserGroups;
_currentUserGroups.RemoveAt(0);
lbxUserSecurityGroups.ItemsSource = null;
lbxUserSecurityGroups.ItemsSource = _currentUserGroups;
My guess is that since I am using the same object for the ItemsSource, that the listbox just doesn't update because it believes it has no reason to (e.g. only updates the item source when it has changed)
Is there some way to force the ItemsSource to update, e.g.:
lbxUserSecurityGroups.UpdateItemsSource();
Note: I am aware a proper way to do do this would be using an ObservableCollection. But this strikes me as odd behavior and I would expect to be able to do what I am trying without hacking around by setting the value to null before setting it to the proper value.