Skip to content
This repository has been archived by the owner. It is now read-only.

When assigning adapters should we set the original adapter's ItemSource to null #256

Open
kjeremy opened this issue Jun 7, 2016 · 1 comment

Comments

@kjeremy
Copy link
Contributor

kjeremy commented Jun 7, 2016

@martijn00 @Cheesebaron

We have a number of classes where we can set an Adapter and there is an inconsistency between whether or not the previous adapter is 'cleared' or not. For instance in MvxRecyclerView at the end of Adapter's set property we do:

if (existing != null)
{
    existing.ItemsSource = null;
}

However in other classes (ex MvxAppCompatRadioGroup) we do not set the ItemsSource to null. I'm inclined to think that we should clear out the old adapter since class instances don't typically share adapters.

@Cheesebaron
Copy link
Member

We should probably have some kind of consistency throughout all the ItemsSource binding classes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants