I have defined my view Layout as follows
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<Mvx.MvxListView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
local:MvxBind="ItemClick PopulateMetricsCat2Command ; ItemsSource RatingList"
local:MvxItemTemplate="@layout/item_met2" />
</LinearLayout>
and List ItemTemplate is as follows
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ffffff">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="20dp"
local:MvxBind="Text MetricName" />
<RatingBar
android:id="@+id/ratingbar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:numStars="5"
android:stepSize="1"
local:MvxBind="Rating ResponseValue" />
</LinearLayout>
I have binded a command on ItemClick event in My MvxListView, but whenever I select some item from List,a specified command is not get executed.Control is nat get trasferred to a command.
That command is as follows
private void DoGoPopulateMetrics(UserRating r)
{
ShowViewModel<PopulateMetricsByCat2ViewModel>(r);
}
Why it not calling this command?
private Cirrious.MvvmCross.ViewModels.MvxCommand<StarRating>
_ratingSelectedCommand;
public System.Windows.Input.ICommand ItemSelectedCommand
{
get{
_ratingSelectedCommand = _ratingSelectedCommand ?? new
Cirrious.MvvmCross.ViewModels.MvxCommand<StarRating>(DoSelectItem);
return _ratingSelectedCommand;
}
}
private void DoSelectItem(StarRating r)
{
ShowViewModel<PopulateMetricsByCat2ViewModel>(r);
}