Beispiel #1
0
 private void DetachAdorners()
 {
     if (_myDropAdorner != null)
     {
         _myDropAdorner.Dispose();
         _myDropAdorner = null;
     }
     if (_myDragAdorner != null)
     {
         _myDragAdorner.Dispose();
         _myDragAdorner = null;
     }
 }
Beispiel #2
0
        private void InitializeDropAdorner(ItemsControl itemsControl, DragEventArgs e)
        {
            if (_myDropAdorner != null)
            {
                return;
            }
            var adornerLayer  = AdornerLayer.GetAdornerLayer(itemsControl);
            var itemContainer = UIHelpers.GetItemContainerFromPointInItemsControl(itemsControl, e.GetPosition(itemsControl));

            if (adornerLayer == null || itemContainer == null)
            {
                return;
            }
            var isPointInTopHalf        = IsDropPointBeforeItem(itemsControl, e);
            var isOrientationHorizontal = (DropIndication == Orientation.Horizontal);

            _myDropAdorner = new DropAdorner(isPointInTopHalf, isOrientationHorizontal, itemContainer, adornerLayer);
        }
Beispiel #3
0
 private void _onDragEnter(object sender, DragEventArgs e) {
    if (_isValidDropTarget(e)) {
       var layer = AdornerLayer.GetAdornerLayer(this);
       _dropAdorner = new DropAdorner(this, _getDragSourceBlock(e));
       _dropAdorner.UpdateInsertionPoint(e);
       layer.Add(_dropAdorner);
    }
 }