private bool Group() { if (DrawObj.Count(shape => shape.IsSelected) > 1) { DrawObj.Add(new Group(DrawObj)); return(true); } else { return(false); } }
private bool Group() { if (DrawObj.Count(shape => shape.IsSelected) > 1) { Group group = new Group(); for (int i = 0; i < DrawObj.Count; i++) { if (DrawObj[i].IsSelected) { group.Add(DrawObj[i]); DrawObj.RemoveAt(i--); } } group.IsSelected = true; DrawObj.Add(group); return(true); } else { return(false); } }