private void DragTop(double scale, ViewModelDesignerItem item, ViewModelSelectionService selectionService) { IEnumerable <ViewModelDesignerItem> groupItems = selectionService.GetGroupMembers(item).Cast <ViewModelDesignerItem>(); double groupBottom = Canvas.GetTop(item) + item.Height; foreach (ViewModelDesignerItem groupItem in groupItems) { double groupItemTop = Canvas.GetTop(groupItem); double delta = (groupBottom - groupItemTop) * (scale - 1); Canvas.SetTop(groupItem, groupItemTop - delta); groupItem.Height = groupItem.ActualHeight * scale; } }
private void DragLeft(double scale, ViewModelDesignerItem item, ViewModelSelectionService selectionService) { IEnumerable <ViewModelDesignerItem> groupItems = selectionService.GetGroupMembers(item).Cast <ViewModelDesignerItem>(); double groupLeft = Canvas.GetLeft(item) + item.Width; foreach (ViewModelDesignerItem groupItem in groupItems) { double groupItemLeft = Canvas.GetLeft(groupItem); double delta = (groupLeft - groupItemLeft) * (scale - 1); Canvas.SetLeft(groupItem, groupItemLeft - delta); groupItem.Width = groupItem.ActualWidth * scale; } }