Пример #1
0
        private void DuplicateSelected()
        {
            var newItems       = new List <IShape>();
            var selectedShapes = SelectedShapes.ToList();

            for (int i = selectedShapes.Count - 1; i >= 0; i--)
            {
                var oldItem = selectedShapes[i];
                var newItem = oldItem.Clone() as IShape;
                oldItem.IsSelected = false;
                newItem.Left      += 10;
                newItem.Top       += 10;
                newItems.Add(newItem);
            }
            foreach (var item in newItems)
            {
                Visuals.Add(item);
            }
        }