MvxAdapter 创建期间 BindingContext 为 null

BindingContext is null during MvxAdapter creation

我在 Android 视图中 运行 以下代码。

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

尝试创建新的 MvxFilteringAdapter 时失败:

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

我正在尝试了解为什么绑定上下文为空以及如何解决它。

您需要调用 base.OnCreate() 否则您不会告诉 MvvmCross 创建 ViewModel。