public static bool Register(this IInputElement element, UIElement relativeTarget = null) { if (dragDatas.ContainsKey(element)) { return(false); } dragDatas[element] = new DragData(element, relativeTarget); element.MouseLeftButtonDown += Element_MouseLeftButtonDown; element.PreviewMouseLeftButtonUp += Element_PreviewMouseLeftButtonUp; element.PreviewMouseMove += Element_PreviewMouseMove; return(true); }
public DragEventArgs(RoutedEvent routedEvent, DragData data) : base(routedEvent, data) { }
private static void EndDrag(DragData item) { item.Stop(); item.IsDragging = false; item.InputTarget.RaiseEvent(new DragEventArgs(DragEndEvent, item)); }