Пример #1
0
 private void ClearSelectionPopups()
 {
     foreach (ICanvasItem item in SelectedItems)
     {
         DesignAidsProvider.RemoveItemFromSelection(item);
     }
 }
Пример #2
0
 public DesignSurface()
 {
     MouseLeftButtonDown += OnMouseLeftButtonDown;
     SelectionChanged += OnSelectionChanged;
     DesignAidsProvider = new DesignAidsProvider(this);
     SelectionHandler = new SelectionHandler(this);
     CommandHandler = new DesignSurfaceCommandHandler(this, this);
 }
Пример #3
0
 public DesignSurface()
 {
     this.SelectionMode   = SelectionMode.Multiple;
     MouseLeftButtonDown += OnMouseLeftButtonDown;
     SelectionChanged    += OnSelectionChanged;
     DesignAidsProvider   = new DesignAidsProvider(this);
     SelectionHandler     = new SelectionHandler(this);
     CommandHandler       = new DesignSurfaceCommandHandler(this, this);
 }
Пример #4
0
        private void OnSelectionChanged(object sender, SelectionChangedEventArgs selectionChangedEventArgs)
        {
            var newItems     = selectionChangedEventArgs.AddedItems;
            var removedItems = selectionChangedEventArgs.RemovedItems;

            foreach (ICanvasItem newItem in newItems)
            {
                DesignAidsProvider.AddItemToSelection(newItem);
            }
            foreach (ICanvasItem removedItem in removedItems)
            {
                DesignAidsProvider.RemoveItemFromSelection(removedItem);
            }
        }
Пример #5
0
        public DesignSurface()
        {
            DefaultStyleKey = typeof(DesignSurface);

            DesignAidsProvider = new DesignAidsProvider(this);
            SelectionHandler   = new SelectionHandler(this);

            PopupsDictionary = new Dictionary <IAdorner, Popup>();

            Children = new CanvasItemCollection();
            KeyDown += OnKeyDown;
            KeyUp   += OnKeyUp;

            SelectionChanged += OnSelectionChanged;
        }