public static void DoDragDrop(DependencyObject element, object obj, DragDropEffects effects)
        {
            var item = obj as IPowerShellCommand;

            if (item != null)
            {
                var content = item.ToString();
                DragDropHelper.DoDragDrop(element, content, DragDropEffects.Copy);
            }
        }
示例#2
0
        protected override void OnMouseMove(System.Windows.Input.MouseEventArgs e)
        {
            CommandListViewItem item = WpfHelper.FindParent <CommandListViewItem>(e.Source as DependencyObject);

            if (item != null && e.LeftButton == MouseButtonState.Pressed)
            {
                DragDropHelper.DoDragDrop(item, item.Content, DragDropEffects.Copy);
            }

            base.OnMouseMove(e);
        }
        protected override void OnMouseMove(MouseEventArgs e)
        {
            TextBlock item = e.OriginalSource as TextBlock;

            if (item != null && e.LeftButton == MouseButtonState.Pressed)
            {
                DragDropHelper.DoDragDrop(item, item.Text, DragDropEffects.Copy);
            }

            base.OnMouseMove(e);
        }