public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) { View itemView = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.Item_Appointment_RecentAppointment_Customer, parent, false); Customer_Appointment_RecentAppointment_ViewModel_ViewHolder vh = new Customer_Appointment_RecentAppointment_ViewModel_ViewHolder(itemView, OnClick); return(vh); }
public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position) { Customer_Appointment_RecentAppointment_ViewModel_ViewHolder vh = holder as Customer_Appointment_RecentAppointment_ViewModel_ViewHolder; Picasso.Get().Load(appointment_list[position].AnhChiNhanh).Into(vh.ServiceImg); vh.TotalService.Text = "Gồm " + appointment_list[position].TongDv.ToString() + " dịch vụ"; vh.OutletName.Text = appointment_list[position].TenChiNhanh; string ngayhen = appointment_list[position].NgayHen.ToString("dd/MM/yyyy"); string giohen = appointment_list[position].GioHen.ToString(); string[] a = giohen.Split(' '); string[] b = ngayhen.Split(' '); string henden = a[1] + " " + b[0]; vh.Time.Text = henden; ((Customer_Appointment_RecentAppointment_ViewModel_ViewHolder)holder).ItemView.LongClick += delegate { appointment_list.Remove(appointment_list[position]); NotifyItemRemoved(position); }; }