public void finalizeDragPreview() { _dragContainer.Children.Remove(_dragPreview); _dragContainer.PreviewMouseMove -= Instance.dragSourceMouseMove; _dragContainer.PreviewMouseUp -= Instance.dragSourceMouseUp; _dragPreview = null; }
public static void SetDragPreview(DependencyObject element,DragPreviewControl value) { element.SetValue(DragPreviewProperty,value); }
public void dragSourceLeftButtonDown(object element,MouseButtonEventArgs e) { FrameworkElement dragsource = element as FrameworkElement; _dragPreview = GetDragPreview(dragsource); _dragContainer = (Canvas)FindAncestor(typeof(Canvas),dragsource); _dragContainer.Children.Add(_dragPreview); dragsource.PreviewMouseMove += Instance.dragSourceMouseMove; _dragContainer.PreviewMouseMove += Instance.dragSourceMouseMove; _dragContainer.PreviewMouseUp += Instance.dragSourceMouseUp; // 按下的时候根据 }