Visual Studio does not recognize the BindingInflate function for MvxFragment

I have the following class:

using Cirrious.MvvmCross.Binding.BindingContext;
using Cirrious.MvvmCross.Droid.Views;
using Cirrious.MvvmCross.Droid.Fragging;
using Cirrious.MvvmCross.Droid.Fragging.Fragments;

public class DifficultyItemFragment : MvxFragment
{
    public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
    {
        var ignored = base.OnCreateView(inflater, container, savedInstanceState);
        return this.BindingInflate(Resource.Layout.DifficultyItemFragment, null);
    }
}

and I get the following error:

 Error  8   ...'QuickShift.Android.Views.DifficultyItemFragment' does not contain a definition for 'BindingInflate' and no extension method 'BindingInflate' accepting a first argument of type 'QuickShift.Android.Views.DifficultyItemFragment' could be found (are you missing a using directive or an assembly reference?)

I looked at the source code of MvvmCross, and BindingInflate really exists in the BindingContext namespace.

Am I missing something ??? I have all the necessary libraries, including Xamarin.Android.Support.v4

enter image description here

UPDATE:

I created a sample project in VS 2013 to illustrate the problem. You will notice that the same problem exists in Fragment1.cs:

Application example

+3
source share
1 answer

BindingInflate- actually an extension method. You need to import the correct namespace (for version 3.5.x).

using Cirrious.MvvmCross.Binding.Droid.BindingContext;

For version 4.x, MvvmCross reorganized namespaces. Proper import:

using MvvmCross.Binding.Droid.BindingContext;

EDIT: ​​ v4.x

+6

All Articles