MVVM: Binding to List IsSelected while tracking IsSynchronizedWithCurrentItem

后端 未结 2 1535
小鲜肉
小鲜肉 2021-02-03 16:13

I\'m tracking ListView selection changes in an MVVM design by binding to IsSelected. I also need to track the current item by enabling IsSynchronizedWithCurrentItem.

I

2条回答
  •  遥遥无期
    2021-02-03 16:26

    The issue seems to happen when you bind to a listbox's IsSelected and use SelectionMode='Single'

    I found that changing the SelectionMode = 'Multiple' and then just added logic to the ViewModel to ensure that there was ever only one item with IsSelected set to true worked.

提交回复
热议问题