private void Start()
        {
            if (_panelAdorner != null || _draggingContainer == null)
            {
                return;
            }

            if (_adornerLayer == null)
            {
                _adornerLayer = AdornerLayer.GetAdornerLayer(_treeView);
            }

            if (_panelAdorner == null)
            {
                _panelAdorner = GetPanelAdorner(_treeView, _draggingContainer);
                _adornerLayer.Add(_panelAdorner);

                _draggingContainer.Opacity = 0.2;
            }

            DragDrop.AddQueryContinueDragHandler(_treeView, OnQueryContinueDrag);
            DragDrop.DoDragDrop(_treeView, _draggingContainer.DataContext, DragDropEffects.Move);
            DragDrop.RemoveQueryContinueDragHandler(_treeView, OnQueryContinueDrag);

            End();
        }
예제 #2
0
        private void EndDrag()
        {
            RootAdornerLayer.Remove(_panelAdorner);
            _panelAdorner = null;

            _dragedChild.Opacity = 1;
            _dragedChild         = null;
        }
        private MousePanelAdorner GetPanelAdorner(UIElement panel, UIElement draggedChild)
        {
            if (_panelAdorner == null)
            {
                _panelAdorner = ConstructMousePanelAdorner(panel, draggedChild);
            }

            return(_panelAdorner);
        }
        private void EndDrag()
        {
            AssociatedObject.PreviewMouseMove -= OnMouseMove;

            RootAdornerLayer.Remove(_panelAdorner);
            _panelAdorner = null;

            _dragedChild.Opacity = 1;
            _dragedChild         = null;
        }
        private void End()
        {
            _treeView.PreviewMouseMove -= OnMouseMove;

            _adornerLayer.Remove(_panelAdorner);
            _panelAdorner = null;

            _draggingContainer.Opacity = 1;
            _draggingContainer         = null;
            _lastDraggingRect          = null;
        }
        //End Drag
        private void EndDrag()
        {
            treeView.PreviewMouseMove -= OnMouseMove;

            _adornerLayer.Remove(_panelAdorner);
            _panelAdorner = null;

            _draggingContainer.Opacity = 1;
            _draggingContainer         = null;

            _lastOverlapContainer = null;
            _startOverlapTime     = DateTime.MinValue;
        }
        //Start Darg
        private void StartDrag()
        {
            if (_panelAdorner != null || _draggingContainer == null)
            {
                return;
            }

            if (_panelAdorner == null)
            {
                _draggingContainer.Tag = 1;
                _panelAdorner          = GetPanelAdorner(treeView, _draggingContainer);
                _draggingContainer.Tag = 0;

                _adornerLayer.Add(_panelAdorner);
                _draggingContainer.Opacity = 0.2;
            }

            DragDrop.AddQueryContinueDragHandler(treeView, OnQueryContinueDrag);
            DragDrop.DoDragDrop(treeView, _draggingContainer, DragDropEffects.Move);
            DragDrop.RemoveQueryContinueDragHandler(treeView, OnQueryContinueDrag);

            EndDrag();
        }