private void AddListElement() { var newItem = new ListElementViewModel { Description = "List Element" }; ListElements.Add(newItem); newItem.Selected = true; }
public void Add(Elements anElement) { try { for (int i = 0; i < Number; i++) { if (ListElements[i] == anElement) { throw new Exception($"Error: Element {anElement.Name} already exists in elements-list"); } } ListElements.Add(anElement); Number++; } catch { } }