protected override void OnLayout(ILayoutInstruction element) { base.OnLayout(element); var pairable = element as IPairable; var contentCell = pairable == null ? element as ContentCell : pairable.Pair as ContentCell ?? element as ContentCell; var headerCell = pairable == null ? element as HeaderedControlCell : pairable.Pair as HeaderedControlCell ?? element as HeaderedControlCell; if (contentCell != null) { if (!string.IsNullOrEmpty(contentCell.SubtextLabel.Text) && contentCell.MinHeight == Cell.StandardCellHeight) { contentCell.MinHeight = 64; } if (contentCell.Image.Dimensions != new Size(1, 1) && contentCell.Image.Dimensions != Size.Empty) { var margin = contentCell.Image.Margin; if (margin.Right < Thickness.LeftMargin) { margin.Right = Thickness.LeftMargin; contentCell.Image.Margin = margin; } } } if (headerCell != null) { OnLayoutHeaderedCell(headerCell); } }
/// <summary> /// Performs layout logic for the specified <paramref name="element"/>. /// </summary> /// <param name="element">The <see cref="ILayoutInstruction"/> instance to lay out.</param> public sealed override void Layout(ILayoutInstruction element) { if (element != null) { OnLayout(element); } }
protected override void OnLayout(ILayoutInstruction element) { var headeredCell = element as HeaderedControlCell; if (headeredCell != null) { OnLayoutHeaderedCell(headeredCell); return; } base.OnLayout(element); }
protected override void OnLayout(ILayoutInstruction element) { base.OnLayout(element); var pairable = element as IPairable; var contentCell = pairable?.Pair as ContentCell ?? pairable as ContentCell; if (contentCell != null) { OnLayoutContentCell(contentCell); } var headerCell = pairable?.Pair as HeaderedControlCell ?? pairable as HeaderedControlCell; if (headerCell != null) { OnLayoutHeaderedCell(headerCell); } }
/// <summary> /// Performs layout logic for the specified <paramref name="element"/> that is determined by the target platform. /// </summary> /// <param name="element">The <see cref="ILayoutInstruction"/> instance to lay out.</param> public abstract void Layout(ILayoutInstruction element);
/// <summary> /// Called when the specified <paramref name="element"/> needs to be laid out. /// </summary> /// <param name="element">The <see cref="ILayoutInstruction"/> instance to be laid out.</param> protected virtual void OnLayout(ILayoutInstruction element) { element.Layout(); }