当我单击项目 GridView 时如何返回 ImageView 实例?
我为 ItemClick 创建自定义绑定事件:
public class ItemClickSquareBinding
: MvxBaseAndroidTargetBinding
{
private readonly GridView _gridView;
private IMvxCommand _command;
public ItemClickSquareBinding(GridView gridView)
{
_gridView = gridView;
_gridView.ItemClick += GridView_ItemClick;
}
private void GridView_ItemClick(object sender, AdapterView.ItemClickEventArgs e)
{
//----->Get ImageView
}
public override void SetValue(object value)
{
_command = (IMvxCommand)value;
}
protected override void Dispose(bool isDisposing)
{
if (isDisposing)
{
_gridView.ItemClick -= GridView_ItemClick;
}
base.Dispose(isDisposing);
}
public override Type TargetType
{
get { return typeof(IMvxCommand); }
}
public override MvxBindingMode DefaultMode
{
get { return MvxBindingMode.OneWay; }
}
}
我的网格视图:
<cirrious.mvvmcross.binding.android.views.MvxBindableGridView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:numColumns="4"
android:gravity="center"
android:listSelector="#00000000"
local:MvxItemTemplate="@layout/itemimage"
local:MvxBind="{'ItemsSource':{'Path':'Squares'}, 'ClickItemSquare':{'Path':'ClickCommand'}}" />
我的图像视图:
<ImageView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res/LeSommet.ZooSnap.UI.Android"
android:layout_width="80dp"
android:layout_height="80dp"
android:padding="5dp"
android:layout_gravity="center"
local:MvxBind="{'ResourcesImagePath':{'Path':'ImagePath'}}"
/>
当我单击项目 GridView 时如何返回 ImageView 实例?(或者我如何返回点击我的对象实例)