示例#1
0
        private void DragLeft(double scale, DesignItem item, SelectionService selectionService)
        {
            IEnumerable<DesignItem> groupItems = selectionService.GetGroupMembers(item).Cast<DesignItem>();

            double groupLeft = Canvas.GetLeft(item) + item.Width;
            foreach (DesignItem groupItem in groupItems)
            {
                double groupItemLeft = Canvas.GetLeft(groupItem);
                double delta = (groupLeft - groupItemLeft) * (scale - 1);
                Canvas.SetLeft(groupItem, groupItemLeft - delta);
                groupItem.Width = groupItem.ActualWidth * scale;
            }
        }
示例#2
0
        private void DragBottom(double scale, DesignItem item, SelectionService selectionService)
        {
            IEnumerable<DesignItem> groupItems = selectionService.GetGroupMembers(item).Cast<DesignItem>();
            double groupTop = Canvas.GetTop(item);
            foreach (DesignItem groupItem in groupItems)
            {
                double groupItemTop = Canvas.GetTop(groupItem);
                double delta = (groupItemTop - groupTop) * (scale - 1);

                Canvas.SetTop(groupItem, groupItemTop + delta);
                groupItem.Height = groupItem.ActualHeight * scale;
            }
        }