Пример #1
0
        private void Tag_OnPreviewMouseDown(object sender, MouseButtonEventArgs e)
        {
            var element = (FrameworkElement)sender;
            Tag tag     = element.DataContext as Tag;

            if (tag == null)
            {
                return;
            }
            var dragElement = new DragProcessor.DragElement((DragProcessor.IDragElement)tag, WorkSpace.Instance.ActiveField);

            DragHelper.SetClick(dragElement, e);
        }
Пример #2
0
        private void Node_OnPreviewMouseDown(object sender, MouseButtonEventArgs e)
        {
            var nodeCtrl = sender as NodeCotrol;

            if (nodeCtrl != null && nodeCtrl.IsDraEnable)
            {
                var nodes = new List <Node>(SelectedNodes);
                var node  = ((FrameworkElement)sender).DataContext as Node;
                if (!nodes.Contains(node))
                {
                    nodes.Add(node);
                }
                var data = new DragProcessor.DragElement(nodes, CurTag);
                DragHelper.SetClick(data, e);
                e.Handled = false;
            }
        }