private void SetupTable() { _source = new GenericTableviewSourceWithHeight <IGroup>(ItemsTable) { GetIdentifierFunc = (group, path) => GroupCell.Identifier, ModifyCellFunc = (cell, path, group) => { var groupCell = cell as GroupCell; if (groupCell != null) { // Only 1 section groupCell.SetIsFirstCell(true); groupCell.GroupDescription.AttributedText = GetText(group.Id, group.Description); } }, GetCellHeightFunc = (view, path, group) => 220, //{ // if (path.Row == 0) // { // return 220; // } // return 180; //}, GetEstimatedHeightFunc = (view, path, group) => 220, //{ // if (path.Row == 0) // { // return 220; // } // return 180; //}, UseAnimations = false, }; _refreshControl = new MvxUIRefreshControl(); ItemsTable.DelaysContentTouches = false; foreach (var subview in ItemsTable.Subviews) { if (subview is UIScrollView) { ((UIScrollView)subview).DelaysContentTouches = false; } } ItemsTable.BackgroundColor = Appearance.Colors.BackgroundColor; ItemsTable.AddSubviews(_refreshControl); ItemsTable.SeparatorStyle = UITableViewCellSeparatorStyle.None; ItemsTable.RegisterClassForCellReuse(typeof(GroupCell), GroupCell.Identifier); ItemsTable.AllowsSelection = false; ItemsTable.Source = _source; }
private void SetupTable() { _source = new GenericTableviewSourceWithHeight <IItemBase>(ItemsTable) { GetIdentifierFunc = (item, path) => { if (item is IEvent) { return(EventCell.Identifier); } return(HeaderImageCell.Identifier); }, RowSelectionFunc = (view, path, item) => { if (item is IEvent) { ViewModel.EventSelected(item.Id); } }, AutoDeselect = true, GetCellHeightFunc = (view, path, arg3) => { return(UIScreen.MainScreen.Bounds.Width * 0.5f + 2); }, GetEstimatedHeightFunc = (view, path, item) => { return(UIScreen.MainScreen.Bounds.Width * 0.5f + 2); }, }; _refreshControl = new MvxUIRefreshControl(); ItemsTable.AddSubview(_refreshControl); ItemsTable.AllowsSelection = true; ItemsTable.RegisterClassForCellReuse(typeof(EventCell), EventCell.Identifier); ItemsTable.RegisterClassForCellReuse(typeof(HeaderImageCell), HeaderImageCell.Identifier); ItemsTable.Source = _source; }
private void SetupTable() { _source = new GenericTableViewSource <INotification>(ItemsTable) { GetIdentifierFunc = (item, path) => NotificationCell.Identifier, RowSelectionFunc = (view, path, arg3) => ViewModel.SelectedCommand.Execute(arg3), AutoDeselect = true, UseAnimations = true, AddAnimation = UITableViewRowAnimation.Top, RemoveAnimation = UITableViewRowAnimation.Bottom, ReplaceAnimation = UITableViewRowAnimation.Middle, }; _refreshControl = new MvxUIRefreshControl(); ItemsTable.RegisterClassForCellReuse(typeof(NotificationCell), NotificationCell.Identifier); ItemsTable.AddSubview(_refreshControl); ItemsTable.BackgroundColor = Appearance.Colors.BackgroundColor; ItemsTable.RowHeight = UITableView.AutomaticDimension; ItemsTable.EstimatedRowHeight = 44; ItemsTable.Source = _source; }
private void SetupTable() { _source = new GenericTableviewSourceWithHeight <IItemBase>(ItemsTable) { GetIdentifierFunc = (item, path) => { if (item is HeaderImage) { return(HeaderImageCell.Identifier); } if (item is Event) { return(EventCell.Identifier); } if (item is EventCategoryDouble) { return(EventCategoryDoubleCell.Identifier); } if (item is IEventCategory) { return(EventCategoryCell.Identifier); } return(AllEventsCell.Identifier); }, GetCellHeightFunc = (view, path, item) => { return(GetCellHeight(item)); }, GetEstimatedHeightFunc = (view, path, item) => { return(GetCellHeight(item)); } // TODO: Vanwege de double image header cell kan row selectie niet want we weten niet op welke plaats er is getapped in de cell, later verbeteren met tap gestures : http://stackoverflow.com/questions/11070874/how-can-i-distinguish-which-part-of-uitableviewcell-has-been-clicked //RowSelectionFunc = (view, path, item) => //{ // if (item is DoubleHeaderImage) // { // ViewModel.CategorySelected(); // } // ViewModel.CategorySelected(item.Id); // ItemsTable.DeselectRow(path, true); //} }; foreach (var subview in ItemsTable.Subviews) { if (subview is UIScrollView) { ((UIScrollView)subview).DelaysContentTouches = false; } } _refreshControl = new MvxUIRefreshControl(); ItemsTable.AddSubview(_refreshControl); ItemsTable.ContentInset = new UIEdgeInsets(0, 0, 5, 0); ItemsTable.BackgroundColor = Appearance.Colors.BackgroundColor; // The image header is only shown when there is only 1 category in the platform ItemsTable.RegisterClassForCellReuse(typeof(HeaderImageCell), HeaderImageCell.Identifier); ItemsTable.RegisterClassForCellReuse(typeof(EventCell), EventCell.Identifier); ItemsTable.RegisterClassForCellReuse(typeof(EventCategoryCell), EventCategoryCell.Identifier); ItemsTable.RegisterClassForCellReuse(typeof(AllEventsCell), AllEventsCell.Identifier); ItemsTable.RegisterClassForCellReuse(typeof(EventCategoryDoubleCell), EventCategoryDoubleCell.Identifier); ItemsTable.Source = _source; }
private void SetupTable() { _membersSource = new GenericTableviewSourceWithHeight <IItemBase>(ItemsTable) { GetIdentifierFunc = (item, path) => { if (item is MemberSearchItem) { return(MembersSearchCell.Identifier); } if (item is MembersButtonItem) { return(MembersButtonCell.Identifier); } if (item is ICompany) { return(MembersCompanyCell.Identifier); } return(MemberCell.Identifier); }, RowSelectionFunc = (view, path, baseItem) => { ViewModel.MemberSelected(baseItem); }, GetCellHeightFunc = (view, path, item) => { if (item is MembersButtonItem) { Debug.WriteLine("BUTTON ITEM AT ROW : {0}", path.Row); } if (item is IUser || item is ICompany) { return(68); } return(62); }, GetEstimatedHeightFunc = (view, path, item) => { if (item is IUser || item is ICompany) { return(68); } return(62); }, //ViewToMove = SearchContainer, //ConstraintToChange = SearchContainerTopConstraint, UseAnimations = true, AddAnimation = UITableViewRowAnimation.Left, RemoveAnimation = UITableViewRowAnimation.Right, ReplaceAnimation = UITableViewRowAnimation.Middle, AutoDeselect = true, }; ItemsTable.BackgroundColor = Appearance.Colors.BackgroundColor; ItemsTable.RegisterClassForCellReuse(typeof(MembersCompanyCell), MembersCompanyCell.Identifier); ItemsTable.RegisterClassForCellReuse(typeof(MembersButtonCell), MembersButtonCell.Identifier); ItemsTable.RegisterClassForCellReuse(typeof(MembersSearchCell), MembersSearchCell.Identifier); ItemsTable.RegisterClassForCellReuse(typeof(MemberCell), MemberCell.Identifier); ItemsTable.Source = _membersSource; _refreshControl = new MvxUIRefreshControl(); ItemsTable.AddSubviews(_refreshControl); }