/// <summary> /// Adds the given value to the selection collection and notifies the listeners that the selection has changed. /// </summary> /// <param name="value"></param> public void Add(T value) { if (ChangedItems == null) { ChangedItems = new MultipleSelectionCache <T>(); } internalValues.Add(value); ChangedItems.addedValues.Add(value); Raise(); }
/// <summary> /// Attempts to remove the specified value from the selection, and if successful, it nofifies the listeners that the selection has changed. /// </summary> /// <param name="value"></param> public void Remove(T value) { if (internalValues.Remove(value)) { if (ChangedItems == null) { ChangedItems = new MultipleSelectionCache <T>(); } ChangedItems.removedValues.Add(value); Raise(); } }
protected override void OnSelectedValueChanged() { ChangedItems = null; }