Beispiel #1
0
 private static void Handle_Drop(object sender, DragEventArgs e)
 {
     _layer.Remove(_adorner);
     _adorner = null;
     if (Reordered != null)
         Reordered(_listbox, new DropData
         {
             OriginalData = ((ListBoxItem)(sender)).DataContext,
             DroppedData =  e.Data
         });
 }
Beispiel #2
0
        private static void StartDrag(FrameworkElement draggedItem)
        {
            ResetAdorner();
            _adorner = new DragAdorner(draggedItem);
            _layer = AdornerLayer.GetAdornerLayer(_listbox);
            _layer.Add(_adorner);

            //blocking call
            DragDrop.DoDragDrop(draggedItem, draggedItem.DataContext, DragDropEffects.Move);

            ResetAdorner();
        }
Beispiel #3
0
 private static void ResetAdorner()
 {
     if (_adorner != null)
     {
         _layer.Remove(_adorner);
         _adorner = null;
     }
 }