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

@kjeremy

Description

@kjeremy

@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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions