升级到Mvvmcross v4.0.0-beta3后,发出绑定到MVXSpinner的问题

时间:2015-09-22 13:21:25

标签: binding mvvmcross

我刚刚将我的所有Mvvmcross库更新到版本4.0.0-beta3,看起来它可能已经破坏了MVXSpinner的绑定。

我在输出中收到以下消息:

MvxBind:警告:5.40无法为SelectedColor绑定SelectedItem创建目标绑定

这是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" />

这是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);                
        }
    }

1 个答案:

答案 0 :(得分:4)

MvxAppCompatSetupHelper.FillTargetFactories Setup.cs

致电FillTargetFactories()