选中项发生变化时转移焦点至模型列表

This commit is contained in:
ww-rm
2025-09-17 23:34:28 +08:00
parent 1f8ed1c31c
commit 699a055707
2 changed files with 6 additions and 6 deletions

View File

@@ -275,12 +275,9 @@ namespace SpineViewer.ViewModels.MainWindow
hit = true;
// 如果点到了没被选中的东西, 清空原先选中的, 改为只选中这一次点的
if (!sp.IsSelected)
{
RequestSelectionChanging?.Invoke(this, new(NotifyCollectionChangedAction.Reset));
RequestSelectionChanging?.Invoke(this, new(NotifyCollectionChangedAction.Add, sp));
}
// 不管点到了哪个, 清空原先选中的, 改为只选中这一次点的, 强制触发一次选中项改变, 以及焦点转移到模型列表
RequestSelectionChanging?.Invoke(this, new(NotifyCollectionChangedAction.Reset));
RequestSelectionChanging?.Invoke(this, new(NotifyCollectionChangedAction.Add, sp));
break;
}

View File

@@ -193,6 +193,9 @@ public partial class MainWindow : Window
default:
break;
}
// 选中项发生变化时转移焦点到列表
_spinesListView.Focus();
}
private void SpinesListView_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)