public ViewHolder(RecentSetsActivity activity, View root) : base(root) { Image = root.FindViewById <ImageView>(Resource.Id.recentSetItem_Image); Name = root.FindViewById <TextView>(Resource.Id.recentSetItem_Name); DeleteButton = root.FindViewById <ImageButton>(Resource.Id.recentSetItem_Delete); DeleteButton.Click += (o, e) => { ImageSet.RemoveRecentSet(activity.ApplicationContext, Set); ((RecentSetsListAdapter)activity.RecyclerView.GetAdapter()).UpdateSet(); activity.RecyclerView.GetAdapter().NotifyItemRemoved(AdapterPosition); }; root.Click += (o, e) => { var data = new Intent() { ClipData = Set.Select(item => new ClipData.Item(item)).ToClipData("Recent set", "text/plain") }; activity.SetResult(Result.Ok, data); activity.Finish(); }; }
public RecentSetsListAdapter(Func <IList <IReadOnlyCollection <string> > > getRecentSets, RecentSetsActivity activity) { m_RecentSets = getRecentSets(); m_GetRecentSets = getRecentSets; m_Activity = activity; }