Пример #1
0
        private void DragLeft(double scale, DesignerItem item, SelectionService selectionService)
        {
            IEnumerable<DesignerItem> groupItems = selectionService.GetGroupMembers(item).Cast<DesignerItem>();

            double groupLeft = Canvas.GetLeft(item) + item.Width;
            foreach (DesignerItem 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 DragTop(double scale, DesignerItem item, SelectionService selectionService)
 {
     IEnumerable<DesignerItem> groupItems = selectionService.GetGroupMembers(item).Cast<DesignerItem>();
     double groupBottom = Canvas.GetTop(item) + item.Height;
     foreach (DesignerItem groupItem in groupItems)
     {
         double groupItemTop = Canvas.GetTop(groupItem);
         double delta = (groupBottom - groupItemTop) * (scale - 1);
         Canvas.SetTop(groupItem, groupItemTop - delta);
         groupItem.Height = groupItem.ActualHeight * scale;
     }
 }