Beispiel #1
0
        public static void BindToEvent(FrameworkElement elt, bool dragInBackground, Type dropType)
        {
            elt.AddHandler(UIElement.MouseLeftButtonDownEvent, (MouseButtonEventHandler)InitiateDrag, dragInBackground);

            void InitiateDrag(object sender, MouseButtonEventArgs e)
            {
                if (e == previousDragEventArgs)
                {
                    return;
                }
                previousDragEventArgs = e;
                TreeDragDriver.InitiateDrag(CreateDragger(e, (FrameworkElement)sender), dropType);
            }
        }
Beispiel #2
0
 private static void BindToItem(bool dragInBackground, FrameworkElement elt, Type eltType)
 {
     TreeDragDriver.BindToEvent(elt, dragInBackground, eltType);
     new TreeDropDriver(elt, eltType).AttachEvents(elt);
 }