实现了多画布下,节点的复制粘贴功能

This commit is contained in:
fengjiayi
2025-05-27 18:32:40 +08:00
parent 7ad6041be6
commit 7848af0363
53 changed files with 1187 additions and 499 deletions

View File

@@ -1,4 +1,6 @@
using CommunityToolkit.Mvvm.ComponentModel;
using Serein.Library.Api;
using Serein.NodeFlow.Env;
using Serein.Workbench.Api;
using Serein.Workbench.Models;
using Serein.Workbench.Services;
@@ -8,19 +10,36 @@ using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
namespace Serein.Workbench.ViewModels
{
internal partial class FlowWorkbenchViewModel : ObservableObject
{
private readonly IFlowEEForwardingService flowEEForwardingService;
private readonly IFlowEnvironment flowEnvironment;
private readonly IWorkbenchEventService workbenchEventService;
private readonly IKeyEventService keyEventService;
public FlowWorkbenchViewModel(IFlowEEForwardingService flowEEForwardingService, IWorkbenchEventService workbenchEventService)
public FlowWorkbenchViewModel(IFlowEnvironment flowEnvironment,
IWorkbenchEventService workbenchEventService,
IKeyEventService keyEventService)
{
this.flowEEForwardingService = flowEEForwardingService;
this.flowEnvironment = flowEnvironment;
this.workbenchEventService = workbenchEventService;
//flowEEForwardingService.OnDllLoad += FlowEEForwardingService_OnDllLoad;
this.keyEventService = keyEventService;
EventManager.RegisterClassHandler(typeof(Window), Keyboard.KeyDownEvent, new KeyEventHandler(OnKeyDown)); // 按下事件
EventManager.RegisterClassHandler(typeof(Window), Keyboard.KeyUpEvent, new KeyEventHandler(OnKeyUp)); // 松开事件
}
private void OnKeyDown(object sender, KeyEventArgs e)
{
keyEventService.KeyDown(e.Key);
}
private void OnKeyUp(object sender, KeyEventArgs e)
{
keyEventService.KeyUp(e.Key);
}
}
}