WPF列表视图选择模式扩展是否会阻止将焦点设置为其他控件? [英] Does WPF listviews selectionmode extended prevent setting focus to other controls?
问题描述
您好,
在扩展选择模式列表视图中更改选择时,我似乎无法将焦点设置为另一个控件。
在单次和多次选择中焦点被交换,因为它应该是扩展的但是我无法使它起作用并且无法解决原因。
编辑:进一步调查。当选择2个项目而不是1时,焦点将应用于第二个控件。
我尝试过:
阅读Microsoft文档时,如果没有shift或ctrl,扩展选择应该单独执行。
由于情况并非如此,我完全迷失了。
我找不到其他人在Google上查询此类问题所以我可能做错了。
Hello,
I cannot seem to set the focus to another control when selection is changed in a extended selectionmode listview.
In single and multi select the focus is swapped as it should be however in extended I cannot get it to function and cannot work out why.
Investigating further. It appears that focus is applied to the second control when 2 items are selected but not 1.
What I have tried:
Reading the Microsoft documentation it appears that extended selection should act as single does when neither shift nor ctrl are held.
Since this is not the case I am completely lost.
I cannot find anyone else querying such issues on google so I may be doing it wrong.
推荐答案
在selectionchange事件结束后使用调度程序设置焦点。
出现扩展选择模式在第一项选择更改事件后获得焦点。
必须是更好的方法,但我还没有找到它。
Ended up using a dispatchtimer to set the focus after the selectionchange event has concluded.
Appears extended selectionmode takes focus after a selectionchange event on first item.
Must be a better way but I haven't found it yet.
这篇关于WPF列表视图选择模式扩展是否会阻止将焦点设置为其他控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!