public override RecyclerView.ViewHolder OnCreateViewHolder([NotNull] ViewGroup parent, int viewType) { var itemType = ViewType.ToItemType(viewType); switch (itemType) { case ItemType.Header: return(OnCreateHeaderViewHolder(parent)); case ItemType.SectionHeader: return(OnCreateSectionHeaderViewHolder(parent, ViewType.GetRequested(viewType))); case ItemType.Item: var viewHolder = OnCreateItemViewHolder(parent, ViewType.GetRequested(viewType)); viewHolder.ItemView.NotNull().ClickWeakSubscribe(ItemView_Click); return(viewHolder); case ItemType.SectionFooter: return(OnCreateSectionFooterViewHolder(parent, ViewType.GetRequested(viewType))); case ItemType.Footer: return(OnCreateFooterViewHolder(parent)); default: throw new ArgumentException($"Unable to create a view holder for \"{viewType}\" view type.", nameof(viewType)); } }