public override CTableViewCell TableCellForRow(CTableView table, int rowIndex) { CTableViewCell cell = m_cells[rowIndex]; if (cell is TableViewCellMock) { TableViewCellMock mockCell = cell as TableViewCellMock; mockCell.DetachFromList(); } return(cell); }
public override CTableViewCell TableCellForRow(CTableView table, int rowIndex) { CTableViewCell cell = table.DequeueReusableCell(m_cellsEntries[rowIndex].type); if (cell == null) { float width = table.Width; float height = m_cellsEntries[rowIndex].height; return((CTableViewCell)Activator.CreateInstance(m_cellsEntries[rowIndex].type, width, height)); } return(cell); }
private void AssertVisibleRows(CTableView table, params CTableViewCell[] cells) { Assert.AreEqual(cells.Length, table.VisibleCellsCount); int index = 0; CTableViewCell cell = table.FirstVisibleCell; CTableViewCell lastCell = null; while (cell != null) { Assert.AreSame(cells[index++], cell); lastCell = cell; cell = cell.NextCell; } Assert.AreEqual(cells.Length, index); Assert.AreSame(lastCell, table.LastVisibleCell); }
private string VisibleCellsToString(CTableView table) { StringBuilder buffer = new StringBuilder("["); int index = 0; for (CTableViewCell cell = table.FirstVisibleCell; cell != null; cell = cell.NextCell) { CConsoleTextEntryView textCell = cell as CConsoleTextEntryView; Assert.IsNotNull(textCell); buffer.Append(textCell.Value); if (++index < table.VisibleCellsCount) { buffer.Append(", "); } } buffer.Append("]"); return(buffer.ToString()); }
internal void AssertVisibleRows(CTableView table, params string[] values) { Assert.AreEqual(values.Length, table.VisibleCellsCount, "expected: " + StringArrayToString(values) + "\n" + "actual: " + VisibleCellsToString(table)); int index = 0; CTableViewCell cell = table.FirstVisibleCell; CTableViewCell lastCell = null; while (cell != null) { CConsoleTextEntryView textCell = cell as CConsoleTextEntryView; Assert.IsNotNull(textCell); Assert.AreEqual(values[index++], textCell.Value); lastCell = cell; cell = cell.NextCell; } Assert.AreEqual(values.Length, index); Assert.AreSame(lastCell, table.LastVisibleCell); }
public override int NumberOfRows(CTableView table) { return(Count); }
public virtual void OnTableCellDeselected(CTableView table, int rowIndex) { }
public virtual int NumberOfRows(CTableView table) { return(0); }
public virtual CTableViewCell TableCellForRow(CTableView table, int rowIndex) { return(null); }
public override CTableViewCell TableCellForRow(CTableView table, int rowIndex) { return(m_cells[rowIndex]); }
public Ayarlar() { this.Icon = "ayarlar.png"; var o = new int(); Device.OnPlatform(iOS: () => o = 20, Android: () => o = 0); Padding = new Thickness(0, o, 0, 0); var c = new Grid() { BackgroundColor = Color.FromHex("#e6e6e6") }; var b = new Grid(); b.RowDefinitions.Add(new RowDefinition { Height = new GridLength(45, GridUnitType.Absolute) }); b.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }); var a = new CTableView { Margin = new Thickness(0, Device.OnPlatform(-6, -6, 0), 0, 0), RowHeight = 45, Intent = TableIntent.Menu, Root = new TableRoot(AppResource.ayarlartableroot) { new TableSection(AppResource.ayarlartablesection1) { new TextCell { Text = AppResource.ayarlartextcell1, TextColor = Color.Black, Command = new Command(() => funcs()) }, new TextCell { Text = AppResource.ayarlartextcell2, TextColor = Color.Black, Command = new Command(() => funcs2()) }, new TextCell { Text = AppResource.ayarlartextcell3, TextColor = Color.Black }, }, new TableSection(AppResource.ayarlartablesection2) { new TextCell { Text = AppResource.ayarlartextcell4, TextColor = Color.Black }, new TextCell { Text = AppResource.ayarlartextcell5, TextColor = Color.Black, Command = new Command(() => funcs3()) }, }, new TableSection(AppResource.ayarlartablesection3) { new TextCell { Text = AppResource.ayarlartextcell6, TextColor = Color.Black, Command = new Command(() => funcs4()) }, new TextCell { Text = AppResource.ayarlartextcell7, TextColor = Color.Black }, new TextCell { Text = AppResource.ayarlartextcell8, TextColor = Color.Black, Command = new Command(() => funcs5()) }, }, new TableSection { new TextCell { Text = AppResource.ayarlartextcell9, TextColor = Color.FromHex("#76c5c4") }, new TextCell { Text = AppResource.ayarlartextcell10, TextColor = Color.FromHex("#76c5c4"), Command = new Command(() => funcs6()) }, } } }; var Ust = new Image() { Source = "UstTabLogo.png", HorizontalOptions = LayoutOptions.Center, Margin = new Thickness(0, 10, 0, 10), HeightRequest = 30, WidthRequest = 30 }; c.Children.Add(Ust, 0, 0); b.Children.Add(c, 0, 0); b.Children.Add(a, 0, 1); Content = b; }