public override nfloat GetHeightForRow(UITableView tableView, Foundation.NSIndexPath indexPath) { //return UITableView.AutomaticDimension; if (indexPath.Row == 0) { return(423); return(UITableView.AutomaticDimension); } else if (indexPath.Row == 1) { return(UITableView.AutomaticDimension); } else { return(0); } }
public override bool CanEditRow(UITableView tableView, Foundation.NSIndexPath indexPath) { var view = _parent.Get(); if (view == null) { return(false); } if (view._favoriteRepoSection == null) { return(false); } if (view.Root[indexPath.Section] == view._favoriteRepoSection) { return(true); } return(false); }
public override UITableViewCell GetCell(UITableView tableView, Foundation.NSIndexPath indexPath) { Package package = Items[indexPath.Row]; PackageListCell cell = (PackageListCell)tableView.DequeueReusableCell(identifier); if (cell == null) { cell = new PackageListCell(); } cell.Update(package); // Always detach and reattach handlers to prevent multiple handlers, memory leaks cell.CellActionButtonClicked -= OnActionButtonClick; cell.CellActionButtonClicked += OnActionButtonClick; return(cell); }
protected override UITableViewCell GetOrCreateCellFor(UITableView tableView, Foundation.NSIndexPath indexPath, object item) { var itemVm = item as IReviewParameterItemVm; switch (itemVm.WidgetType) { case ReviewWidgetType.Score: return(tableView.DequeueReusableCell(ScoreCell.Key, indexPath)); case ReviewWidgetType.TotalScore: return(tableView.DequeueReusableCell(TotalScoreCell.Key, indexPath)); case ReviewWidgetType.Text: var cell = (TextCell)tableView.DequeueReusableCell(TextCell.Key, indexPath); cell.FieldInputAccessoryView = FieldInputAccessoryView; return(cell); } return(null); }
public override void RowSelected(UITableView tableView, Foundation.NSIndexPath indexPath) { if (indexPath.Row == 0) { var sb = UIStoryboard.FromName("Main", null); var ctlr = sb.InstantiateViewController("LoginViewController"); NavigationController.PushViewController(ctlr, true); } else if (indexPath.Row == 1) { var sb = UIStoryboard.FromName("Main", null); var ctlr = sb.InstantiateViewController("EmbedTweetViewController"); NavigationController.PushViewController(ctlr, true); } else { var ctlr = new UserTimelineViewController(); NavigationController.PushViewController(ctlr, true); } }
public override UITableViewCell GetCell(UITableView tableView, Foundation.NSIndexPath indexPath) { var cell = tableView.DequeueReusableCell(cellIdentifier) ?? new UITableViewCell(UITableViewCellStyle.Default, cellIdentifier); if (indexPath.Row == 0) { cell.TextLabel.Text = "Log In With Twitter"; } else if (indexPath.Row == 1) { cell.TextLabel.Text = "Embedded Tweet"; } else { cell.TextLabel.Text = "Embedded User Timeline"; } return(cell); }
public override nfloat GetHeightForRow(UITableView tableView, Foundation.NSIndexPath indexPath) { var review = (reviews[indexPath.Row] as ReviewBase); int len = String.IsNullOrWhiteSpace(review.Review) ? 0 : review.Review.Length; if (len == 0) { return(30); } else if (len < 47) { return(45); } else if (len < 94) { return(60); } return(75); //return cellHeightDictionary.ContainsKey(indexPath.Row) ? cellHeightDictionary [indexPath.Row] : 75; }
public override UITableViewCell GetCell(UITableView tableView, Foundation.NSIndexPath indexPath) { var cell = new UITableViewCell(UITableViewCellStyle.Default, indexPath.ToString()); string[] countries = null; #if DO_CYCLES if (viewController.Data.TryGetValue(viewController.Data.Keys.ElementAt((int)indexPath.Section), out countries)) { #else if (data.TryGetValue(data.Keys.ElementAt((int)indexPath.Section), out countries)) { #endif var item = countries [indexPath.Row]; cell.TextLabel.Text = item ?? ""; } else { cell.TextLabel.Text = ""; } return(cell); }
public override void RowSelected(UITableView tableView, Foundation.NSIndexPath indexPath) { if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) { this.original.RowSelected(tableView, indexPath); } else { var rectangle = tableView.RectForRowAtIndexPath(indexPath); nint index = 0; for (nint i = 0; i < indexPath.Section; i++) { index += tableView.NumberOfRowsInSection((int)i); } index += indexPath.Row; var item = ListItemCollection.GetSortedData()[(int)index]; ShowPopover(item, rectangle, tableView); } }
public override UITableViewCell GetCell(UITableView tableView, Foundation.NSIndexPath indexPath) { Sample data = Items[indexPath.Row]; BaseCell cell = (BaseCell)tableView.DequeueReusableCell(identifier); if (cell == null) { if (data.IsHeader) { cell = new MapListHeaderCell(); } else { cell = new MapListCell(); } } cell.Update(data); return(cell); }
public override void Selected(Foundation.NSIndexPath indexPath) { if (indexPath.Section == 1) { ClearPartsList(); // if in plumber mode if (MyConstants.EmployeeType == MyConstants.EmployeeTypes.Plumber) { // show a dialog prompting user to choose a tubing upgrade type var chooseTUType = new UIAlertView("", "Please choose the tubing upgrade type", null, "Option 1", "Option 2"); chooseTUType.Dismissed += delegate(object sender, UIButtonEventArgs e) { switch (e.ButtonIndex) { case 0: // if option 1 SetPartsToStandardBuild(16); // set the job price to 29.5 ThisJob.MoneyToCollect = 32.5; break; case 1: // if option 2 SetPartsToStandardBuild(31); // set the job price to 75 ThisJob.MoneyToCollect = 75; break; } }; chooseTUType.Show(); } else { SetPartsToStandardBuild(16); } } base.Selected(indexPath); }
public override UITableViewCell GetCell(UITableView tableView, Foundation.NSIndexPath indexPath) { var cell = tableView.DequeueReusableCell(detailsCell); if (cell == null) { cell = new UITableViewCell(UITableViewCellStyle.Subtitle, detailsCell); cell.Accessory = UITableViewCellAccessory.DisclosureIndicator; cell.SelectionStyle = UITableViewCellSelectionStyle.None; } var test = TestResults[indexPath.Row]; cell.TextLabel.Text = test.test.GetType().Name; cell.DetailTextLabel.Text = test.Result ? "Success" : $"Failed {test.Exception.Message}"; // cell.BackgroundColor = test.Result ? UIColor.White : UIColor.FromRGBA(255, 0, 0, 45); cell.AccessoryView = new UIView(new CoreGraphics.CGRect(0, 0, 30, 30)) { BackgroundColor = test.Result ? UIColor.Green : UIColor.Red }; return(cell); }
public override UITableViewCell GetCell(UITableView tableView, Foundation.NSIndexPath indexPath) { UITableViewCell cell; var e = Events.ElementAt(indexPath.Row); if (e.TeamId == HomeTeam.Id) { cell = tableView.DequeueReusableCell("HomeEventCell", indexPath); (cell.ViewWithTag(201) as UILabel).Text = HomeTeam.Players.First(p => p.Id == e.PlayerId).ShortName; } else { cell = tableView.DequeueReusableCell("AwayEventCell", indexPath); (cell.ViewWithTag(201) as UILabel).Text = AwayTeam.Players.First(p => p.Id == e.PlayerId).ShortName; } (cell.ViewWithTag(200) as UILabel).Text = Floorball.UIHelper.GetMatchFullTime(e.Time); cell = SetImage(cell, e); return(cell); }
public override UITableViewCell GetCell(UITableView tableView, Foundation.NSIndexPath indexPath) { // Dequeing Reusable Cell whit an id from the projet's contants var cell = tableView.DequeueReusableCell(CONSTANTS.CELL_ID, indexPath) as RepoTableViewCell; var item = this.Items[indexPath.Row]; // Dynamic Cell Setup cell.name = item.name; /* MARK: - * * COMMENT: Very simple and built in feature in C# for parsing a * string date with native methods... * * AUTHOR: @gchriswill */ DateTime date = DateTime.Parse(item.created_at); cell.createdAt = date.ToString("mm/dd/yyyy"); cell.description = item.description; return(cell); }
public override UITableViewCell GetCell(UITableView tableView, Foundation.NSIndexPath indexPath) { var cell = tableView.DequeueReusableCell("TeamMatchCell", indexPath); var match = MatchesByLeague.ElementAt(indexPath.Section).ElementAt(indexPath.Row); (cell.ViewWithTag(200) as UILabel).Text = match.Date.ToString(); if (Team.Id == match.HomeTeamId) { (cell.ViewWithTag(201) as UILabel).Text = Team.Name; (cell.ViewWithTag(203) as UILabel).Text = AppDelegate.SharedAppDelegate.UoW.TeamRepo.GetTeamById(match.AwayTeamId).Name; } else { (cell.ViewWithTag(203) as UILabel).Text = Team.Name; (cell.ViewWithTag(201) as UILabel).Text = AppDelegate.SharedAppDelegate.UoW.TeamRepo.GetTeamById(match.HomeTeamId).Name; } (cell.ViewWithTag(202) as UILabel).Text = match.ScoreH.ToString(); (cell.ViewWithTag(204) as UILabel).Text = match.ScoreA.ToString(); return(cell); }
public nfloat GetHeight(UITableView tableView, Foundation.NSIndexPath indexPath) { return(44f); }
public override nfloat GetHeightForRow(UITableView tableView, Foundation.NSIndexPath indexPath) { return(TamañoCelda); }
public override void RowSelected(UITableView tableView, Foundation.NSIndexPath indexPath) { MenuSelected?.Invoke(indexPath.Row); tableView.DeselectRow(indexPath, true); }
public override void RowSelected(UITableView tableView, Foundation.NSIndexPath indexPath) { _source.RowSelected(tableView, indexPath); }
public override bool CanEditRow(UITableView tableView, Foundation.NSIndexPath indexPath) { return(false); }
public override UITableViewCell GetCell(UITableView tableView, Foundation.NSIndexPath indexPath) { return(cell); }
public override UICollectionViewCell GetCell(UICollectionView collectionView, Foundation.NSIndexPath indexPath) { var c = collectionView.DequeueReusableCell("C", indexPath) as HostCell; if (c.VizView != cell) { c.VizView = cell; cell.Frame = c.ContentView.Bounds; cell.AutoresizingMask = UIViewAutoresizing.FlexibleDimensions; c.ContentView.Add(cell); } return(c); }
public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, Foundation.NSIndexPath indexPath) { switch (editingStyle) { case UITableViewCellEditingStyle.Delete: var section = Root[indexPath.Section]; var element = section[indexPath.Row]; _parent.DeletePinnedRepo(element as PinnedRepoElement); break; } }
public override UITableViewCellEditingStyle EditingStyleForRow(UITableView tableView, Foundation.NSIndexPath indexPath) { if (_parent._favoriteRepoSection != null && Root[indexPath.Section] == _parent._favoriteRepoSection) { return(UITableViewCellEditingStyle.Delete); } return(UITableViewCellEditingStyle.None); }
public override CoreGraphics.CGSize GetSizeForItem(UICollectionView collectionView, UICollectionViewLayout layout, Foundation.NSIndexPath indexPath) { //return base.GetSizeForItem(collectionView, layout, indexPath); return(new CoreGraphics.CGSize(collectionView.Bounds.Size.Width, 100)); }
public override void Selected(Foundation.NSIndexPath indexPath) { var todoItem = tasks[indexPath.Row]; ShowTaskDetails(todoItem); }
public override UITableViewCell GetCell(UITableView tableView, Foundation.NSIndexPath indexPath) { if (!data.IsList && indexPath.Section == 0) { if (indexPath.Row == 0) { var c = tableView.DequeueReusableCell("TS"); if (c == null) { c = new UITableViewCell(UITableViewCellStyle.Default, "TS"); c.TextLabel.Lines = 5; c.TextLabel.AdjustsFontSizeToFitWidth = true; c.TextLabel.Font = UIFont.FromName("Menlo-Bold", 16.0f); } c.TextLabel.Text = data.ToStringValue; return(c); } else { var c = tableView.DequeueReusableCell("GH"); if (c == null) { c = new UITableViewCell(UITableViewCellStyle.Default, "GH"); c.TextLabel.TextColor = UIColor.Gray; } c.TextLabel.Text = data.HashDisplayString; return(c); } } else if (!data.IsList && indexPath.Section == 2000) { var c = tableView.DequeueReusableCell("H"); if (c == null) { c = new UITableViewCell(UITableViewCellStyle.Default, "H"); } c.TextLabel.Text = ""; try { c.TextLabel.TextColor = tableView.TintColor; c.TextLabel.Text = data.Hierarchy[indexPath.Row].Name; } catch (Exception ex) { Log(ex); } return(c); } else if ((!data.IsList && indexPath.Section == 2) || (data.IsList && indexPath.Section == 0)) { var c = tableView.DequeueReusableCell("E"); if (c == null) { c = new UITableViewCell(UITableViewCellStyle.Default, "E"); c.Accessory = UITableViewCellAccessory.DisclosureIndicator; } c.TextLabel.Text = ""; try { c.TextLabel.TextColor = tableView.TintColor; c.TextLabel.Text = data.Elements[indexPath.Row].Title; } catch (Exception ex) { Log(ex); } return(c); } else { var c = tableView.DequeueReusableCell("P"); if (c == null) { c = new UITableViewCell(UITableViewCellStyle.Subtitle, "P"); c.TextLabel.Font = UIFont.FromDescriptor(UIFontDescriptor.PreferredCaption1, 12.0f); c.DetailTextLabel.Font = UIFont.FromDescriptor(UIFontDescriptor.PreferredCaption1, 16.0f); c.DetailTextLabel.MinimumFontSize = 10.0f; c.DetailTextLabel.AdjustsFontSizeToFitWidth = true; } try { c.DetailTextLabel.TextColor = tableView.TintColor; var prop = data.Properties [indexPath.Row]; c.TextLabel.Text = prop.Name; try { var v = prop.Value; c.DetailTextLabel.Text = prop.ValueString; if (v != null && !IsPrimitive(v.GetType())) { c.Accessory = UITableViewCellAccessory.DisclosureIndicator; } else { c.Accessory = UITableViewCellAccessory.None; } } catch (Exception ex) { Log(ex); var i = ex; while (i.InnerException != null) { i = i.InnerException; } c.DetailTextLabel.Text = i.Message; c.DetailTextLabel.TextColor = UIColor.Red; c.Accessory = UITableViewCellAccessory.None; } } catch (Exception ex) { Log(ex); } return(c); } }
public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, Foundation.NSIndexPath indexPath) { switch (editingStyle) { case UITableViewCellEditingStyle.Delete: var player = Players [indexPath.Row]; _controller.DeletePlayer(player); Players.RemoveAt(indexPath.Row); tableView.DeleteRows(new Foundation.NSIndexPath[] { indexPath }, UITableViewRowAnimation.Left); break; } }
public override UITableViewCell GetCell(UITableView tableView, Foundation.NSIndexPath indexPath) { var cell = base.GetCell(tableView, indexPath) as HistoryCell; return(cell); }