Пример #1
0
        private void OnPresetTreeFolderDragOver(object sender, DragEventArgs e)
        {
            try
            {
                Point currentPosition = e.GetPosition(this.presetTreeView);

                if (DragDropUtilities.IsMovementBigEnough(this.lastPresetTreeViewMouseDown, currentPosition))
                {
                    // Verify that this is a valid drop and then store the drop target
                    this.DecideDropTarget(e);

                    if (this.dropTarget != null)
                    {
                        this.ShowFolderMoveAdorner(this.dropTarget);
                    }
                    else
                    {
                        this.RemoveFolderMoveAdorner();
                    }
                }

                e.Handled = true;
            }
            catch (Exception)
            {
            }
        }
Пример #2
0
        private void OnPresetTreeItemMouseMove(object sender, MouseEventArgs e)
        {
            if (e.LeftButton == MouseButtonState.Pressed)
            {
                Point currentPosition = e.GetPosition(this.presetTreeView);

                if (DragDropUtilities.IsMovementBigEnough(this.lastPresetTreeViewMouseDown, currentPosition))
                {
                    this.draggedPreset = this.presetTreeView.SelectedItem as PresetViewModel;

                    if (this.draggedPreset != null)
                    {
                        var windowManager = StaticResolver.Resolve <IWindowManager>();

                        windowManager.SuspendDropOnWindows();
                        DragDrop.DoDragDrop((DependencyObject)sender, this.presetTreeView.SelectedItem, DragDropEffects.Move);
                        windowManager.ResumeDropOnWindows();
                    }
                }
            }
        }