public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) { View itemView = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.task_card, parent, false); TasksViewHolder vh = new TasksViewHolder(itemView, Onclick); return(vh); }
public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position) { DialogHelpers dialogs = new DialogHelpers(); TasksViewHolder vh = holder as TasksViewHolder; vh.taskName.Text = mTasks[position].mTaskName; vh.taskProjectName.Text = mTasks[position].mTaskProjectName; vh.taskPercentComplete.Text = mTasks[position].mTasksPercentComplete; vh.taskWork.Text = mTasks[position].mtasksWork; vh.taskDuration.Text = mTasks[position].mTasksDuration; vh.deleteTask.Click += delegate { dialogs.DeleteTaskDialog(main, mTasks[position].mTaskProjectName, mTasks[position].mTaskName).Show(); }; vh.editTask.Click += delegate { dialogs.EditTaskDialog(main, mTasks[position].mTaskProjectName, mTasks[position].mTaskName).Show(); }; }