mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-05 08:46:34 +08:00
block
This commit is contained in:
@@ -10,7 +10,7 @@ using AIStudio.Wpf.DiagramDesigner.Helpers;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
public static class DragAndDropProps
|
||||
public static class DragAndDropProps
|
||||
{
|
||||
#region EnabledForDrag
|
||||
|
||||
@@ -31,10 +31,10 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
|
||||
private static void OnEnabledForDragChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
FrameworkElement fe = (FrameworkElement) d;
|
||||
FrameworkElement fe = (FrameworkElement)d;
|
||||
|
||||
|
||||
if((bool)e.NewValue)
|
||||
if ((bool)e.NewValue)
|
||||
{
|
||||
fe.PreviewMouseDown += Fe_PreviewMouseDown;
|
||||
fe.MouseMove += Fe_MouseMove;
|
||||
@@ -67,10 +67,15 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
|
||||
static void Fe_MouseMove(object sender, System.Windows.Input.MouseEventArgs e)
|
||||
{
|
||||
Point? dragStartPoint = GetDragStartPoint((DependencyObject)sender);
|
||||
|
||||
if (e.LeftButton != MouseButtonState.Pressed)
|
||||
dragStartPoint = null;
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Point? dragStartPoint = GetDragStartPoint((DependencyObject)sender);
|
||||
var point = e.GetPosition((IInputElement)sender);
|
||||
if (dragStartPoint == point)
|
||||
return;
|
||||
|
||||
if (dragStartPoint.HasValue && ((FrameworkElement)sender).DataContext is ToolBoxData toolBoxData)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user