using System.Windows.Controls; using System.Windows; using System.Windows.Input; namespace SHJX.Service.WorkFlowEdit { public class LinkThumb : Control { public LinkThumbKind Kind { get; set; } protected Point? MouseDownPoint { get; set; } protected override void OnMouseDown(MouseButtonEventArgs e) { if (e.ChangedButton == MouseButton.Left) { var link = this.DataContext as LinkBase; var view = VisualHelper.FindParent(link); if (link != null && view != null) { MouseDownPoint = e.GetPosition(view); view.LinkTool.BeginDrag(MouseDownPoint.Value, link, this.Kind); e.Handled = true; } } } } }