Using Xamarin.Android with MVVMCross. When Select the value from MVXSpinner that Not Binding to SelectedYear Property in the Model. When Load the page debugger comes in to SelectedYear Property, But When I select the value from spinner it want comes into SelectedYear. I haven't get any errors. Please Any one Advice me where I am wrong.
Found Binding Issue on Output Window
MvxBind:Warning:228.30 Failed to create target binding for binding SelectedItem for SelectedYear [0:] MvxBind:Warning:228.30 Failed to create target binding for binding SelectedItem for SelectedYear 11-09 11:50:03.756 I/mono-stdout(32419): MvxBind:Warning:228.30 Failed to create target binding for binding SelectedItem for SelectedYear
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#FFFFFF"
android:orientation="vertical"
android:layout_alignParentRight="true"
android:layout_marginRight="50dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/Retread.Collection.UI.DroidPhone.DotYear"
style="@style/LabelTextView" />
<MvxSpinner
android:id="@+id/txtYear"
android:layout_width="20dp"
android:layout_height="wrap_content"
android:overlapAnchor="false"
local:MvxItemTemplate="@drawable/year_spinner"
local:MvxDropDownItemTemplate="@drawable/year_spinnerdropdown"
android:hint="@string/Retread.Collection.UI.DroidPhone.Year"
local:MvxBind="ItemsSource Year;SelectedItem SelectedYear"
style="@style/AppSpinnerStyle" />
Year_spinner.xml File below.
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18dip"
android:singleLine="true"
android:textColor="#000000"
local:MvxBind="Text DisplayYear"/>
Year_spinnerdropdown.xml file Below.
<?xml version="1.0" encoding="utf-8"?>
<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
style="?android:attr/spinnerDropDownItemStyle"
android:singleLine="true"
android:background="#ffffff"
android:layout_width="match_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:ellipsize="marquee"
local:MvxBind="Text DisplayYear" />
In View Model I have Following Properties. And In the Year Model I have a Property DisplayYear.
private List<YearModel> _Year;
public List<YearModel> Year
{
get
{
return _Year;
}
set
{
_Year = value;
RaisePropertyChanged(() => Year);
}
}
public YearModel SelectedYear
{
get
{
return Model.SelectedYear;
}
set
{
Model.SelectedYear = value;
RaisePropertyChanged(() => SelectedYear);
}
}