#0023 整理项目结构

This commit is contained in:
zhengxuan.zhang
2026-03-15 00:24:02 +08:00
parent dc35faabf1
commit 1b1b0872c7
43 changed files with 303 additions and 220 deletions
@@ -0,0 +1,40 @@
using System.Windows;
using System.Windows.Controls;
using Prism.Ioc;
using Telerik.Windows.DragDrop;
using XplorePlane.ViewModels;
namespace XplorePlane.Views
{
public partial class PipelineEditorView : UserControl
{
private const string DragFormat = "OperatorDescriptor";
public PipelineEditorView()
{
InitializeComponent();
Loaded += OnLoaded;
}
private void OnLoaded(object sender, RoutedEventArgs e)
{
if (DataContext == null)
DataContext = ContainerLocator.Container.Resolve<PipelineEditorViewModel>();
// 启用拖拽目标 + 注册 Drop 事件
PipelineListBox.AllowDrop = true;
DragDropManager.AddDropHandler(PipelineListBox, OnOperatorDropped, true);
}
private void OnOperatorDropped(object sender, Telerik.Windows.DragDrop.DragEventArgs e)
{
if (DataContext is not PipelineEditorViewModel vm) return;
var descriptor = DragDropPayloadManager.GetDataFromObject(e.Data, DragFormat) as OperatorDescriptor;
if (descriptor == null) return;
vm.AddOperatorCommand.Execute(descriptor.Key);
e.Handled = true;
}
}
}