private void SelectFirstElement() { ClearSelection(); var el = LayoutElements.OfType <LayoutMap>().FirstOrDefault() ?? LayoutElements.FirstOrDefault(); if (el != null) { AddToSelection(new List <LayoutElement> { el }); } }
/// <summary> /// Gets requested element from the layout /// </summary> protected T GetElement <T>(ElementType role) where T : LayoutElement { return(LayoutElements.FirstOrDefault(item => item is T && item.Type == role) as T); }