Example #1
0
        private static void sourceElement_MouseMove(object sender, MouseEventArgs e)
        {
            if (e.LeftButton == MouseButtonState.Pressed)
            {
                IDragSource      dragSource    = DragDropHelper.GetDragSource(sender as DependencyObject);
                FrameworkElement sourceElement = sender as FrameworkElement; //dragSource.SourceElement;
                var item = sourceElement as System.Windows.Controls.ListBoxItem;

                if (dragSource.IsDraggable(sourceElement))
                {
                    DataObject data = dragSource.GetDataObject(sourceElement);
                    DragDrop.DoDragDrop(sourceElement, data, dragSource.SupportedEffects);
                }
            }
        }