コード例 #1
0
ファイル: DragDrop.cs プロジェクト: swfightforyl/MyDragDrop
 public static void SetDragDropPreviewControl(DependencyObject element,DragPreview value)
 {
     element.SetValue(DragDropPreviewControlProperty,value);
 }
コード例 #2
0
ファイル: DragDrop.cs プロジェクト: swfightforyl/MyDragDrop
 private void DragSource_PreviewMouseMove(object sender,MouseEventArgs e)
 {
     _dragDropPreview = GetDragDropPreviewControl(sender as DependencyObject);
     if (_dragDropPreview != null&&_dragDropContainer!=null)
     {
         _dragDropPreview.Opacity = 0.7;
         _dragDropContainer.Children.Add(_dragDropPreview);
         Mouse.Capture(_dragDropPreview);
         Mouse.OverrideCursor = Cursors.Hand;
         Canvas.SetLeft(_dragDropPreview, _initialMousePosition.X - 20);
         Canvas.SetTop(_dragDropPreview, _initialMousePosition.Y - 15);
     }
 }