private void deleteButton_Click(object sender, RoutedEventArgs e) { object o = sourceListBox.SelectedItem; if (o != null) { SourceCollectionEdited.Remove(o); TargetCollectionEdited.Remove(o); } UpdateCheckBoxes(); UpdateSelectedValues(); }
private void AddOrRemoveItem(bool add, object item) { if (!_isLoaded || _cleaningExtraItems || TargetCollection == null) { return; } if (item == null) { return; } if (add) { AddItemToTargetCollection(item); } else { TargetCollectionEdited.Remove(item); } UpdateCheckBoxes(); UpdateSelectedValues(); }