Example #1
0
        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);
        }
Example #2
0
 public DragEventArgs(RoutedEvent routedEvent, DragData data) : base(routedEvent, data)
 {
 }
Example #3
0
 private static void EndDrag(DragData item)
 {
     item.Stop();
     item.IsDragging = false;
     item.InputTarget.RaiseEvent(new DragEventArgs(DragEndEvent, item));
 }