From ed1f451121a0b04ba812e6735cca8c8c03cf8bd0 Mon Sep 17 00:00:00 2001 From: zengwenjie <1663900244@qq.com> Date: Thu, 18 Sep 2025 16:55:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E4=B9=89=E6=8B=96=E8=B5=B7=E5=89=8D?= =?UTF-8?q?=E4=B8=8E=E6=94=BE=E7=BD=AE=E5=89=8D=E7=9A=84=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DeedyDesigner/Deedy.Activity/ActionViewer.cs | 50 ++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/DeedyDesigner/Deedy.Activity/ActionViewer.cs b/DeedyDesigner/Deedy.Activity/ActionViewer.cs index 898f188..14e9501 100644 --- a/DeedyDesigner/Deedy.Activity/ActionViewer.cs +++ b/DeedyDesigner/Deedy.Activity/ActionViewer.cs @@ -975,6 +975,56 @@ namespace Deedy.Activity // 事件触发前可以进行一定的处理逻辑 RaiseEvent(args); } + /// + /// 准备拖动 + /// + /// + /// 在对象被拖动之前发生,可以被取消 + /// + public static readonly RoutedEvent PreviewActionDragEvent = EventManager.RegisterRoutedEvent("ActionDrag", RoutingStrategy.Tunnel, + typeof(EventHandler), typeof(ActionViewer)); + /// + /// 事件「准备拖动」封装 + /// + public event EventHandler PreviewActionDrag + { + add { AddHandler(PreviewActionDragEvent, value); } + remove { RemoveHandler(PreviewActionDragEvent, value); } + } + /// + /// 事件「准备拖动」触发 + /// + /// 事件参数 + protected virtual void RaiseEvent_PreviewActionDrag(CancelRoutedEventArgs args) + { + // 事件触发前可以进行一定的处理逻辑 + RaiseEvent(args); + } + /// + /// 准备放置 + /// + /// + /// 在对象被放置之前发生,可以被取消 + /// + public static readonly RoutedEvent PreviewActionDropEvent = EventManager.RegisterRoutedEvent("ActionDrop", RoutingStrategy.Tunnel, + typeof(EventHandler), typeof(ActionViewer)); + /// + /// 事件「准备放置」封装 + /// + public event EventHandler PreviewActionDrop + { + add { AddHandler(PreviewActionDropEvent, value); } + remove { RemoveHandler(PreviewActionDropEvent, value); } + } + /// + /// 事件「准备放置」触发 + /// + /// 事件参数 + protected virtual void RaiseEvent_PreviewActionDrop(CancelRoutedEventArgs args) + { + // 事件触发前可以进行一定的处理逻辑 + RaiseEvent(args); + } #endregion } }