public ListSource(DialogViewController controller, IList list, IEnumerable<Type> viewTypes) : base(controller)
{
Sections = new Dictionary<int, Section>();
var section = new Section(controller) { DataContext = list };
IList<Type> viewTypesList = null;
if (viewTypes != null)
viewTypesList = viewTypes.ToList();
var genericType = list.GetType().GetGenericArguments().FirstOrDefault();
CellId = new NSString(genericType.ToString());
section.ViewTypes.Add(CellId, viewTypesList);
Sections.Add(0, section);
SelectedItems = list.GetType().CreateGenericListFromEnumerable(null);
CellFactory = new TableCellFactory<UITableViewCell>(CellId);
//SelectionDisplayMode = SelectionDisplayMode.Collapsed;
//CollapsedList = new List<object>();
// foreach(var item in Sections[0].DataContext)
// {
// CollapsedList.Add(item);
// }
// Sections[0].DataContext.Clear();
//
//IsCollapsed = true;
}