2025-05-27 18:32:40 +08:00
|
|
|
|
using Serein.Workbench.Node.ViewModel;
|
|
|
|
|
|
using Serein.Workbench.ViewModels;
|
2025-03-18 21:01:15 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
using System.Windows;
|
|
|
|
|
|
using System.Windows.Controls;
|
|
|
|
|
|
using System.Windows.Data;
|
|
|
|
|
|
using System.Windows.Documents;
|
|
|
|
|
|
using System.Windows.Input;
|
|
|
|
|
|
using System.Windows.Media;
|
|
|
|
|
|
using System.Windows.Media.Imaging;
|
|
|
|
|
|
using System.Windows.Navigation;
|
|
|
|
|
|
using System.Windows.Shapes;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Serein.Workbench.Views
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// FlowLibrarysView.xaml 的交互逻辑
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public partial class FlowLibrarysView : UserControl
|
|
|
|
|
|
{
|
2025-05-27 18:32:40 +08:00
|
|
|
|
private FlowLibrarysViewModel ViewModel => DataContext as FlowLibrarysViewModel ?? throw new ArgumentNullException();
|
2025-07-30 21:15:07 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// FlowLibrarysView 构造函数
|
|
|
|
|
|
/// </summary>
|
2025-03-18 21:01:15 +08:00
|
|
|
|
public FlowLibrarysView()
|
|
|
|
|
|
{
|
|
|
|
|
|
this.DataContext = App.GetService<Locator>().FlowLibrarysViewModel;
|
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
}
|
2025-05-27 18:32:40 +08:00
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
}
|
2025-03-18 21:01:15 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|