修正「ActionViewer」的拖放装饰器逻辑

This commit is contained in:
zengwenjie
2025-09-26 14:50:03 +08:00
parent ba725b7bfe
commit 64dc58fd08

View File

@@ -734,7 +734,7 @@ namespace Deedy.Activity
{
this.IsDragging = true;
ToolTipService.SetIsEnabled(this, false);
//TODO执行拖放校验并设置「_CanDropInParent」与「_CanDropChild」两个临时控制字段
base.OnDragEnter(e);
}
protected override void OnDragLeave(DragEventArgs e)
@@ -743,9 +743,9 @@ namespace Deedy.Activity
base.OnDragLeave(e);
}
protected internal bool _CanDropInParent = false;
protected internal bool _CanDropChild = false;
protected internal DropPlacement _DropPlacement = DropPlacement.Uncertain;
protected internal bool _CanDropInParent = false; // 通过组装校验逻辑设置此字段
protected internal bool _CanDropChild = false; // 通过组装校验逻辑设置此字段
protected internal DropPlacement _DropPlacement = DropPlacement.Uncertain; // 用于最终放置逻辑
protected override void OnDragOver(DragEventArgs e)
{
//HACK这里要考虑父容器的布局方向
@@ -760,12 +760,12 @@ namespace Deedy.Activity
if (this._CanDropInParent && (currentPoint.Y < 10 || currentPoint.Y < 10))
{
this._DropPlacement = DropPlacement.BeforeMe;
this.UpdateDragAdorner(this._DropPlacement);
this.UpdateDragAdorner(this._DropPlacement, (this.ActionElement?.ParentElement as ICombinedElement)?.Direction);
}
else if (this._CanDropInParent && (hitElement.ActualHeight - currentPoint.Y < 10 || hitElement.ActualWidth - currentPoint.X < 10))
{
this._DropPlacement = DropPlacement.BehindMe;
this.UpdateDragAdorner(this._DropPlacement);
this.UpdateDragAdorner(this._DropPlacement, (this.ActionElement?.ParentElement as ICombinedElement)?.Direction);
}
else if (this._CanDropChild)
{