private void SubscribeToDragDropEvents()
 {
     DragDropManager.AddDragInitializeHandler(AssociatedControl, OnDragInitialize);
     DragDropManager.AddGiveFeedbackHandler(AssociatedControl, OnGiveFeedback);
     DragDropManager.AddDragDropCompletedHandler(AssociatedControl, OnDragDropCompleted);
     DragDropManager.AddDragOverHandler(AssociatedControl, OnDragOver);
 }
Beispiel #2
0
 private void SubscribeToDragDropEvents()
 {
     DragDropManager.AddDragInitializeHandler(this.AssociatedObject, OnDragInitialize);
     DragDropManager.AddGiveFeedbackHandler(this.AssociatedObject, OnGiveFeedback);
     DragDropManager.AddDropHandler(this.AssociatedObject, OnDrop);
     DragDropManager.AddDragDropCompletedHandler(this.AssociatedObject, OnDragDropCompleted);
 }
Beispiel #3
0
        public ApplicationModuleRelationView()
        {
            InitializeComponent();
            this.DataContext = ViewModel;

            DragDropManager.AddDragDropCompletedHandler(listBox1, new DragDropCompletedEventHandler(ListDropComplete), true);
            DragDropManager.AddDragDropCompletedHandler(listBox2, new DragDropCompletedEventHandler(ListDropComplete), true);
            DragDropManager.AddDragOverHandler(radGridView, new Telerik.Windows.DragDrop.DragEventHandler(ListDragOver), true);
        }
Beispiel #4
0
        protected override void OnAttached()
        {
            base.OnAttached();

            DragDropManager.AddDragInitializeHandler(this.AssociatedObject, OnDragInitialize);
            DragDropManager.AddGiveFeedbackHandler(this.AssociatedObject, OnGiveFeedback);
            DragDropManager.AddDragDropCompletedHandler(this.AssociatedObject, OnDragDropCompleted);
            DragDropManager.AddDropHandler(this.AssociatedObject, OnDrop);
        }
        protected virtual void Initialize()
        {
            DragDropManager.AddDragInitializeHandler(this.AssociatedObject, OnDragInitialize, true);
            DragDropManager.AddDropHandler(this.AssociatedObject, OnDrop, true);
            DragDropManager.AddDragDropCompletedHandler(this.AssociatedObject, OnDragDropCompleted, true);
            DragDropManager.AddDragOverHandler(this.AssociatedObject, OnDragOver, true);

            this.AssociatedObject.DataLoaded += RadTreeListView1_DataLoaded;
        }
Beispiel #6
0
        public Example()
        {
            InitializeComponent();

            DragDropManager.AddDragInitializeHandler(this.ListBox1, OnDragInitialize);
            DragDropManager.AddDragDropCompletedHandler(this.ListBox1, OnDragDropCompleted);

            DragDropManager.AddDropHandler(this.ListBox2, OnDrop);
            DragDropManager.AddDragOverHandler(this.ListBox2, OnDragOver);
        }
Beispiel #7
0
        private void InitializeDragAndDrop()
        {
            DragDropManager.RemoveDragInitializeHandler(this, new DragInitializeEventHandler(this.OnDragInitialized));
            DragDropManager.RemoveDragOverHandler(this, new Telerik.Windows.DragDrop.DragEventHandler(this.OnDragOver));
            DragDropManager.RemoveDragDropCompletedHandler(this, new Telerik.Windows.DragDrop.DragDropCompletedEventHandler(this.OnElementDragDropCompleted));
            DragDropManager.RemoveDropHandler(this, new Telerik.Windows.DragDrop.DragEventHandler(this.OnDropCompleted));
            DragDropManager.RemoveGiveFeedbackHandler(this, new Telerik.Windows.DragDrop.GiveFeedbackEventHandler(this.OnGiveFeedback));

            DragDropManager.AddDragInitializeHandler(this, new DragInitializeEventHandler(this.OnDragInitialized));
            DragDropManager.AddDragOverHandler(this, new Telerik.Windows.DragDrop.DragEventHandler(this.OnDragOver));
            DragDropManager.AddDragDropCompletedHandler(this, new Telerik.Windows.DragDrop.DragDropCompletedEventHandler(this.OnElementDragDropCompleted));
            DragDropManager.AddDropHandler(this, new Telerik.Windows.DragDrop.DragEventHandler(this.OnDropCompleted));
            DragDropManager.AddGiveFeedbackHandler(this, new Telerik.Windows.DragDrop.GiveFeedbackEventHandler(this.OnGiveFeedback));
        }
Beispiel #8
0
        private static void OnShowArrowDragCueChanged(DependencyObject target, DependencyPropertyChangedEventArgs args)
        {
            var element = (FrameworkElement)target;

            if ((bool)args.NewValue)
            {
                DragDropManager.AddDragInitializeHandler(element, OnElementDragInitialize, true);
                DragDropManager.AddDragDropCompletedHandler(element, OnElementDragDropCompleted, true);
                element.Unloaded += OnElementUnloaded;
            }
            else
            {
                UnsubscribeFromEvents(element);
            }
        }
        private static void TrayDragInitialized(object sender, DragInitializeEventArgs e)
        {
            RadToolBarTray tray    = sender as RadToolBarTray;
            RadToolBar     toolBar = e.Source as RadToolBar;

            if (tray == null || toolBar == null)
            {
                return;
            }

            DragDropInfo info = new DragDropInfo(toolBar, tray);

            lastInitializedInfo = info;
            if (trayToHostDict.ContainsKey(tray) || !tray.IsMouseOver)
            {
                MoveToolBarToDragVisual(info, tray);
            }
            else
            {
                SetHitTesting(info.Tray.Items);
            }

            SetActiveToolBarStyle(info.ToolBar);
            if (trayToHostDict.ContainsKey(info.Tray))
            {
                trayToHostDict[info.Tray].Opacity = 0;
            }

            DragDropManager.AddDragDropCompletedHandler(info.ToolBar, ToolBarDragDropCompleted);
            DragDropManager.AddGiveFeedbackHandler(info.ToolBar, ToolBarGiveFeedback);

            e.Data             = info;
            e.DragVisual       = info.DragVisual;
            e.DragVisualOffset = e.RelativeStartPoint;
            e.AllowedEffects   = DragDropEffects.All;
            e.Handled          = true;
        }
        private static void TrayDragInitialized(object sender, DragInitializeEventArgs e)
        {
            RadToolBarTray tray    = sender as RadToolBarTray;
            RadToolBar     toolBar = e.Source as RadToolBar;

            if (tray == null || toolBar == null)
            {
                return;
            }

            DragDropInfo info = new DragDropInfo(toolBar, tray);

            lastInitializedInfo = info;

            SetActiveToolBarStyle(info.ToolBar);

            DragDropManager.AddDragDropCompletedHandler(info.ToolBar, ToolBarDragDropCompleted);

            e.DragVisual       = CreateDragImageFromToolBar(info.ToolBar);
            e.Data             = info;
            e.DragVisualOffset = e.RelativeStartPoint;
            e.AllowedEffects   = DragDropEffects.All;
            e.Handled          = true;
        }