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.
Hi)
Share sample please
Because it must work
Which kind of collection do you use? You should use Observable Collection
https://github.com/AndreiMisiukevich/CardView/issues/26
Is it your case too ?
@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