From 430a1e6ed99d6e9fd42d87d7efcdceaa51a09c26 Mon Sep 17 00:00:00 2001 From: "zhengxuan.zhang" Date: Sun, 15 Mar 2026 10:50:52 +0800 Subject: [PATCH] =?UTF-8?q?#0026=20=E5=9B=BE=E5=83=8F=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E7=AE=B1=E6=96=B0=E5=A2=9E=E7=A7=BB=E5=8A=A8=E5=92=8C=E5=88=A0?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PipelineEditorViewModel.cs | 24 +++++++++++++++ .../ImageProcessing/PipelineEditorView.xaml | 30 ++++++++++++++++++- 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/XplorePlane/ViewModels/ImageProcessing/PipelineEditorViewModel.cs b/XplorePlane/ViewModels/ImageProcessing/PipelineEditorViewModel.cs index e75220d..a914794 100644 --- a/XplorePlane/ViewModels/ImageProcessing/PipelineEditorViewModel.cs +++ b/XplorePlane/ViewModels/ImageProcessing/PipelineEditorViewModel.cs @@ -56,6 +56,8 @@ namespace XplorePlane.ViewModels SaveAsPipelineCommand = new DelegateCommand(async () => await SaveAsPipelineAsync()); DeletePipelineCommand = new DelegateCommand(async () => await DeletePipelineAsync()); LoadPipelineCommand = new DelegateCommand(async () => await LoadPipelineAsync()); + MoveNodeUpCommand = new DelegateCommand(MoveNodeUp); + MoveNodeDownCommand = new DelegateCommand(MoveNodeDown); } // ── State Properties ────────────────────────────────────────── @@ -135,6 +137,8 @@ namespace XplorePlane.ViewModels public DelegateCommand SaveAsPipelineCommand { get; } public DelegateCommand DeletePipelineCommand { get; } public DelegateCommand LoadPipelineCommand { get; } + public DelegateCommand MoveNodeUpCommand { get; } + public DelegateCommand MoveNodeDownCommand { get; } // ── Command Implementations ─────────────────────────────────── @@ -197,6 +201,26 @@ namespace XplorePlane.ViewModels TriggerDebouncedExecution(); } + private void MoveNodeUp(PipelineNodeViewModel node) + { + if (node == null) return; + int index = PipelineNodes.IndexOf(node); + if (index <= 0) return; + PipelineNodes.Move(index, index - 1); + RenumberNodes(); + TriggerDebouncedExecution(); + } + + private void MoveNodeDown(PipelineNodeViewModel node) + { + if (node == null) return; + int index = PipelineNodes.IndexOf(node); + if (index < 0 || index >= PipelineNodes.Count - 1) return; + PipelineNodes.Move(index, index + 1); + RenumberNodes(); + TriggerDebouncedExecution(); + } + private void ReorderOperator(PipelineReorderArgs args) { if (args == null) return; diff --git a/XplorePlane/Views/ImageProcessing/PipelineEditorView.xaml b/XplorePlane/Views/ImageProcessing/PipelineEditorView.xaml index 6ff726d..46f017e 100644 --- a/XplorePlane/Views/ImageProcessing/PipelineEditorView.xaml +++ b/XplorePlane/Views/ImageProcessing/PipelineEditorView.xaml @@ -161,10 +161,11 @@ ScrollViewer.HorizontalScrollBarVisibility="Disabled"> - + + @@ -196,11 +197,38 @@ Margin="6,0,0,0" FontFamily="Microsoft YaHei UI" FontSize="12" Text="{Binding DisplayName}" /> + + + +