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}" /> + + + +