Cardview: Items source won't update

Created on 13 May 2018  路  8Comments  路  Source: AndreiMisiukevich/CardView

Hi Andrei, currently, your CardView can't update Items collection if it's updated. Is it right? So, I have to dispose current CardView and create the other to init new Items collection.

bug resolved

All 8 comments

Hi)
Share sample please
Because it must work

Which kind of collection do you use? You should use Observable Collection

@AndreiMisiukevich Not really, but similar. My issue is if I create a button on the same page with CardsView and click it to update the ObservableCollection Items (Add 1 more, update or replace by other ObservableCollection), then the CardsView always keeps the origin ObservableCollection. For example, I use your sample (CardsSampleView) to add a ToolbarItem and SetBinding it to ItemsChangedCommand:
var refreshItem = new ToolbarItem { Text = "**Refresh**", CommandParameter = true }; refreshItem.SetBinding(MenuItem.CommandProperty, nameof(SharedSampleViewModel.ItemsChangedCommand));

In the ItemsChangedCommand I clear Items collection and add 1 other item:
ItemsChangedCommand = new Command(x => { Items.Clear(); Items.Add(new { Source = CreateSource(), Ind = _ImageCount++, Color = Color.White }); });

The CardsView won't change anything, still showing the original Items.

@troyvnit thanks ) I will check it =)

Could you pls try again with latest sample's code
It seems, that I fixed it with https://github.com/AndreiMisiukevich/CardView/issues/26

I tried on iPhone simulator, but I believe, that it should work the same for iOS and Android

Perfect! It worked. Thank a lot @AndreiMisiukevich. Just wait for next release :D.

@troyvnit good) I will create new release after confirmation of fixing #26 (Today-tomorrow)

1.4.2 have been published
It will be available soon

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jungjanos picture jungjanos  路  8Comments

fjorge-joshkautz picture fjorge-joshkautz  路  8Comments

IgorPopov56 picture IgorPopov56  路  4Comments

InquisitorJax picture InquisitorJax  路  6Comments

2092015 picture 2092015  路  5Comments