示例#1
0
 private void Select(DiagramItem itemBlock)
 {
     Select(new List <DiagramItem>()
     {
         itemBlock
     });
 }
示例#2
0
        private void Unselect(DiagramItem itemBlock)
        {
            if (IsUpdatingSelectedItems)
            {
                return;
            }

            BeginUpdateSelectedItems();
            SelectedItems.Remove(ItemContainerGenerator.ItemFromContainer(itemBlock));
            EndUpdateSelectedItems();
        }
示例#3
0
 private void ToggleSelect(DiagramItem diagramItem)
 {
     if (diagramItem.IsSelected)
     {
         Unselect(diagramItem);
     }
     else
     {
         Select(diagramItem);
     }
 }
示例#4
0
 private void UpdateItemPosition(DiagramItem block)
 {
     if (!IsMeasureValid)
     {
         Measure(Size.Empty);
     }
     if (block is DiagramItemBlock)
     {
         Canvas.SetLeft(block, block.X - block.DesiredSize.Width / 2.0);
         Canvas.SetTop(block, block.Y - block.DesiredSize.Height / 2.0);
     }
     else
     {
         Canvas.SetLeft(block, block.X);
         Canvas.SetTop(block, block.Y);
     }
 }