public void AddSelectedElement(int id, bool ctrl, bool multi) { if (SelectedElementsCount != 0 & !multi && !ctrl) { UnselectElements(); } if (SelectedElements.Contains(id)) { SelectedElements.Remove(id); UnselectedElement?.Invoke(id); } else { SelectedElements.Add(id); SelectedElement?.Invoke(id); } ModelChanged?.Invoke(this); }
public void UnselectElements() { SelectedElements.ForEach(id => UnselectedElement?.Invoke(id)); SelectedElements.Clear(); ModelChanged?.Invoke(this); }