列表视图结合SelectedItems [英] Binding SelectedItems of Listview
问题描述
我怎么能结合 SelectedItems
A 的ListView
的?
我的的ListView
的 multipleSelection
属性,我使用的CollectionView
它的内容。
how can i bind SelectedItems
of a ListView
?
My ListView
has multipleSelection
attribute and I'm using CollectionView
for its contents..
我听说过的附加属性,我试图用一个我发现这里实现此:
<一href=\"http://stackoverflow.com/questions/1297643/sync-selecteditems-in-a-muliselect-listbox-with-a-collection-in-viewmodel\">Sync SelectedItems在muliselect列表框,在视图模型集合
I've heard about Attached property and I tried implementing this with the one I found here: Sync SelectedItems in a muliselect listbox with a collection in ViewModel
我可以通过点击行多个选择项,但我不能使用移
键盘多选择多行瞬间......此外,当我过滤我收集并刷新它,我的选择都刷新后取消。
I can multiple select the items by clicking rows but I can't use the Shift
keyboard for multi-selecting many rows instantly... Also, when I filter my collection and refresh it, my selection are all deselected after the refresh..
我怎样才能让这个每当我的的CollectionView
刷新后,previously selecteditems被刷新后,仍然选择......?
How can I make it so that whenever my CollectionView
refreshes, the previously selecteditems are still selected after the refresh...?
有人能也帮助我如何操纵逻辑通过我的视图模型所选项目吗?
Can someone also help me how to manipulate logically the selected items through my viewmodel?
推荐答案
可能是你应该在 IsSelected
属性添加到ListViewItem的的视图模型。
May be you should add the IsSelected
property to the ListViewItem's view model.
这篇关于列表视图结合SelectedItems的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!