MvxExpandableListAdapter抛出异常

时间:2016-09-20 10:42:35

标签: c# xaml xamarin xamarin.android mvvmcross

我正在尝试使用自定义适配器加载MvxExpandableListView。

public class ExpandView : MvxActivity
{

    protected override void OnCreate(Bundle bundle)
    {
        base.OnCreate(bundle);
        SetContentView(Resource.Layout.ExpandView);
        var list = FindViewById<MvxExpandableListView>(Resource.Id.TheExpandView);
        list.Adapter = new MyCustomAdaptor(this);
    }

    private class MyCustomAdaptor :MvxExpandableListAdapter
    {
        public MyCustomAdaptor(Context context)
            : base(context)
        {

        }
    }
}

我得到以下例外。

  

MvvmCross.Platform.Exceptions.MvxException:在创建MvxAdapter期间,bindingContext为null - 只有在特定绑定上下文放置在堆栈上时才应创建Adapter

0 个答案:

没有答案
相关问题