private void DragSource_PreviewLeftButtonDown(object sender,MouseButtonEventArgs e) { DependencyObject element = sender as DependencyObject; _dragPreview = GetDragPreviewControl(element); _dragContainer = (Canvas)DragDropV2.FindAncestor(typeof(Canvas),element); _topWindow = (Window)DragDropV2.FindAncestor(typeof(Window), element); _initialMousePosition = e.GetPosition(_topWindow); }
public static void SetDragPreviewControl(DependencyObject element,DragPreviewV2 value) { element.SetValue(DragPreviewControlProperty,value); }