public void Configure(ProfileDivisionModel divisionModels) { int numberOfDivisions = 0; foreach (var division in divisionModels.Divisions) { var divisionView = DivisionView.Create; divisionView.Configure(division, divisionModels.DivisionPressedEvent); divisionView.Frame = new CGRect((LocalConstants.Profile_DivisionWidth * numberOfDivisions), 0, LocalConstants.Profile_DivisionWidth, LocalConstants.Profile_DivisionHeight); _scrollView.AddSubview(divisionView); numberOfDivisions++; } if (divisionModels.AddDivisionEvent != null) { var addDivisionModel = new ProfileDivisionDetails(); addDivisionModel.AddButtonImage = true; addDivisionModel.Id = 0; var divisionButtonView = DivisionView.Create; divisionButtonView.Configure(addDivisionModel, divisionModels.AddDivisionEvent); divisionButtonView.Frame = new CGRect((LocalConstants.Profile_DivisionWidth * numberOfDivisions), 0, LocalConstants.Profile_DivisionWidth, LocalConstants.Profile_DivisionHeight); _scrollView.AddSubview(divisionButtonView); numberOfDivisions++; } var contentSize = LocalConstants.Profile_DivisionWidth * (numberOfDivisions); this.ContentView.Frame = new CGRect(0, 0, contentSize, LocalConstants.Profile_DivisionHeight); _scrollView.ContentInset = new UIEdgeInsets(0, 5, 0, 0); _scrollView.ContentSize = new CGSize(contentSize, LocalConstants.Profile_DivisionHeight); _scrollView.AutosizesSubviews = false; _scrollView.LayoutIfNeeded(); }
public UserProfileSource(UITableView tableView, ProfileDetailsModel details, ProfileDivisionModel division) { _tableView = tableView; _details = details; _division = division; tableView.RegisterNibForCellReuse(DetailsCell.Nib, DetailsCell.Key); tableView.RegisterNibForCellReuse(DivisionsCell.Nib, DivisionsCell.Key); }