我刚刚将我的所有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);
}
}
答案 0 :(得分:4)
从MvxAppCompatSetupHelper.FillTargetFactories
Setup.cs
FillTargetFactories()