2021-08-05 18:20:22 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Windows;
|
|
|
|
|
|
using System.Windows.Controls;
|
|
|
|
|
|
using System.Windows.Controls.Primitives;
|
|
|
|
|
|
using System.Windows.Media;
|
|
|
|
|
|
|
2022-10-28 22:45:39 +08:00
|
|
|
|
namespace AIStudio.Wpf.DiagramDesigner.Controls
|
2021-08-05 18:20:22 +08:00
|
|
|
|
{
|
|
|
|
|
|
public class PointDragThumb : Thumb
|
|
|
|
|
|
{
|
|
|
|
|
|
public PointDragThumb()
|
|
|
|
|
|
{
|
|
|
|
|
|
base.DragDelta += new DragDeltaEventHandler(DragThumb_DragDelta);
|
|
|
|
|
|
base.DragStarted += DragThumb_DragStarted;
|
|
|
|
|
|
base.DragCompleted += DragThumb_DragCompleted;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void DragThumb_DragStarted(object sender, DragStartedEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void DragThumb_DragCompleted(object sender, DragCompletedEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void DragThumb_DragDelta(object sender, DragDeltaEventArgs e)
|
|
|
|
|
|
{
|
2023-01-24 16:20:39 +08:00
|
|
|
|
if (this.DataContext is ConnectorPointModel point)
|
2021-08-05 18:20:22 +08:00
|
|
|
|
{
|
2023-01-21 22:01:10 +08:00
|
|
|
|
point.X += e.HorizontalChange;
|
|
|
|
|
|
point.Y += e.VerticalChange;
|
2021-08-05 18:20:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|