mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-03 00:00:49 +08:00
实现了多画布下,节点的复制粘贴功能
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user