#0026 图像工具箱新增移动和删除

This commit is contained in:
zhengxuan.zhang
2026-03-15 10:50:52 +08:00
parent 880cdfc937
commit 430a1e6ed9
2 changed files with 53 additions and 1 deletions
@@ -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<PipelineNodeViewModel>(MoveNodeUp);
MoveNodeDownCommand = new DelegateCommand<PipelineNodeViewModel>(MoveNodeDown);
}
// ── State Properties ──────────────────────────────────────────
@@ -135,6 +137,8 @@ namespace XplorePlane.ViewModels
public DelegateCommand SaveAsPipelineCommand { get; }
public DelegateCommand DeletePipelineCommand { get; }
public DelegateCommand LoadPipelineCommand { get; }
public DelegateCommand<PipelineNodeViewModel> MoveNodeUpCommand { get; }
public DelegateCommand<PipelineNodeViewModel> 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;