• 问题:WPF中MVVM模式下 ListView绑定ListCollectionView时,CurrentChanged无法触发

  • 解决方案:

    • 初期方案:利用ListView的SelectionChanged事件在界面后台逻辑中调用VM业务逻辑。 —— 弊端:前后耦合度增加。
    • 最终方案:设置ListView的IsSynchronizedWithCurrentItem属性为True。
  • 经历(吐槽):

    • 百度看了几页没找到解决方案,谷歌第一页就找到了。 —— 真不是我崇洋媚外,我也很无奈。
    • 搜索词:“WPF ListView ListCollectionView CurrentChanged” —— 供验证,偶木有骗人。

解:奇葩史

相关文章:

  • 2022-12-23
  • 2021-07-18
  • 2021-09-30
  • 2022-12-23
  • 2022-12-23
  • 2021-06-16
  • 2022-12-23
  • 2021-07-29
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-12
  • 2022-12-23
  • 2022-12-23
  • 2022-01-24
相关资源
相似解决方案