Example #1
0
        private void SelectFirstElement()
        {
            ClearSelection();

            var el = LayoutElements.OfType <LayoutMap>().FirstOrDefault() ?? LayoutElements.FirstOrDefault();

            if (el != null)
            {
                AddToSelection(new List <LayoutElement> {
                    el
                });
            }
        }
Example #2
0
 /// <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);
 }