items not showing in mvxlistview

后端 未结 1 873
误落风尘
误落风尘 2021-01-22 19:55

I am using mvvmcross (with great fun) but I keep having problems with adding and removing items from mvxlistview:

My View is binded to a List of items which are retrieve

1条回答
  •  迷失自我
    2021-01-22 20:31

    Unless you are actually using a different source List or an INotifyCollectionChanged supporting collection, then the MvxAdapter will receive your change notification - but will not actually know it has any work to do.

    In order to work around this, either:

    • use a new List
    • switch to using an ObservableCollection
    • implement a custom IMvxAdapter which always responds to change notifications, even when it appears no change has happened. To do this, override if (_itemsSource == value) return; in SeItemsSource in https://github.com/slodge/MvvmCross/blob/v3/Cirrious/Cirrious.MvvmCross.Binding.Droid/Views/MvxAdapter.cs

    0 讨论(0)
提交回复
热议问题