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

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,5 @@
using Serein.Workbench.ViewModels;
using Serein.Workbench.Node.ViewModel;
using Serein.Workbench.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -21,10 +22,32 @@ namespace Serein.Workbench.Views
/// </summary>
public partial class FlowLibrarysView : UserControl
{
private FlowLibrarysViewModel ViewModel => DataContext as FlowLibrarysViewModel ?? throw new ArgumentNullException();
public FlowLibrarysView()
{
this.DataContext = App.GetService<Locator>().FlowLibrarysViewModel;
InitializeComponent();
}
private void FlowLibrarysView_Drop(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
{
string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
foreach (string file in files)
{
if (file.EndsWith(".dll"))
{
ViewModel.LoadFileLibrary(file);
}
}
}
}
private void FlowLibrarysView_DragOver(object sender, DragEventArgs e)
{
e.Effects = DragDropEffects.Copy;
e.Handled = true;
}
}
}