jalley
jalley

Reputation: 105

Issue binding to MVXSpinner after upgrading to Mvvmcross v4.0.0-beta3

I just updated all of my Mvvmcross libraries to version 4.0.0-beta3 and it looks like it may have broken the binding of the MVXSpinner.

I get the following message in the output:

MvxBind:Warning: 5.40 Failed to create target binding for binding SelectedItem for SelectedColor

Here is the xml:

<MvxSpinner
               android:layout_width="match_parent"
               android:layout_height="wrap_content"
               android:id="@+id/colorSpinner"
               android:spinnerMode="dropdown"                 
               android:layout_below="@id/maintoolbar"
               local:MvxBind="ItemsSource ColorList; SelectedItem SelectedColor" />

Here is the ViewModel:

    public HomeViewModel(IKrizzmaService service, IMvxMessenger messenger)
        :base(service, messenger)
    {
        SelectedColor = "Blue";
    }

    private static string[] _colorList = { "Yellow", "Brown", "White", "Blue", "Orange", "Red", "Green", "Purple" };
    public string[] ColorList
    {
        get { return _colorList; }
    }

    private string _selectedColor;
    public string SelectedColor
    {
        get { return _selectedColor; }
        set
        {
            _selectedColor = value;
            RaisePropertyChanged(() => SelectedColor);                
        }
    }

Upvotes: 1

Views: 476

Answers (1)

Jeremy
Jeremy

Reputation: 611

Call MvxAppCompatSetupHelper.FillTargetFactories from your Setup.cs's FillTargetFactories()

Upvotes: 4

Related Questions