Colin Bacon
Colin Bacon

Reputation: 15609

BindingContext is null during MvxAdapter creation

I'm running the following code in an Android view.

protected override void OnCreate(Bundle bundle)
{
    var autoComplete = this.FindViewById<MvxAutoCompleteTextView>(Resource.Id.AutoComplete);
    autoComplete.Adapter = new MvxFilteringAdapter(this);
}

It is failing when trying to create a new MvxFilteringAdapter with:

bindingContext is null during MvxAdapter creation - Adapter's should only be created when a specific binding context has been placed on the stack

I'm trying to understand why the binding context is null and how to resolve it.

Upvotes: 1

Views: 741

Answers (1)

Cheesebaron
Cheesebaron

Reputation: 24460

You need to call base.OnCreate() otherwise you are not telling MvvmCross to create a ViewModel.

Upvotes: 4

Related Questions