Example #1
0
 /// <summary>
 /// Instead of setting size based on the view's Frame, use this.
 /// Only used when column and/or row size is -1.
 /// </summary>
 public static Grid.Layout.Cell UseFixedSize(this Grid.Layout.Cell cell,
                                             CGSize size) => new Grid.Layout.Cell(cell.View,
                                                                                  new Grid.Layout.Position(cell.Position)
 {
     UseFixedSize = true,
     FixedSize    = size
 });
Example #2
0
 /// <summary>
 /// Instead of setting size based on the view's Frame, use this.
 /// Only used when column and/or row size is -1.
 /// </summary>
 public static Grid.Layout.Cell UseFixedSize(this Grid.Layout.Cell cell,
                                             nfloat w, nfloat h) => new Grid.Layout.Cell(cell.View,
                                                                                         new Grid.Layout.Position(cell.Position)
 {
     UseFixedSize = true,
     FixedSize    = new CGSize(w, h)
 });
Example #3
0
 internal static Grid.Layout.Cell Align(Grid.Layout.Cell cell, Grid.Layout.Alignment alignment,
                                        Grid.Layout.Direction direction)
 {
     if (direction.HasFlag(Grid.Layout.Direction.Horizontal))
     {
         cell = cell.Horizontally(alignment);
     }
     if (direction.HasFlag(Grid.Layout.Direction.Vertical))
     {
         cell = cell.Vertically(alignment);
     }
     return(cell);
 }
Example #4
0
 /// <summary>
 /// If the view is a UIScrollView and this is set, autosize will use
 /// ContentSize of the scroll view to size based on actual contained
 /// content.
 /// </summary>
 public static Grid.Layout.Cell UseContentSize(this Grid.Layout.Cell cell) =>
 cell.UseContentSize(true);
Example #5
0
 /// <summary>
 /// If the view is a UIScrollView and this is set, autosize will use
 /// ContentSize of the scroll view to size based on actual contained
 /// content.
 /// </summary>
 public static Grid.Layout.Cell UseContentSize(this Grid.Layout.Cell cell,
                                               bool useContentSize) => new Grid.Layout.Cell(cell.View,
                                                                                            new Grid.Layout.Position(cell.Position)
 {
     UseContentSize = useContentSize
 });
Example #6
0
 /// <summary>
 /// This is an alternative to using Vertically() and/or Horizontally() to set
 /// alignment. It sets one of both directions to Start.
 /// </summary>
 public static Grid.Layout.Cell AlignEnd(this Grid.Layout.Cell cell,
                                         Grid.Layout.Direction direction = Grid.Layout.Direction.Both) =>
 Align(cell, Grid.Layout.Alignment.End, direction);
Example #7
0
 /// <summary>
 /// When set, the cell's view will not be positioned during layout nor sized. This is useful
 /// when the X,Y position of a sub-view is set in some other way.
 /// </summary>
 public static Grid.Layout.Cell NoPosition(this Grid.Layout.Cell cell) => new Grid.Layout.Cell(cell.View, new Grid.Layout.Position(cell.Position)
 {
     NoPosition = true
 });
Example #8
0
 public static Grid.Layout.Cell MarginLeft(this Grid.Layout.Cell cell,
                                           nfloat left) => new Grid.Layout.Cell(cell.View,
                                                                                new Grid.Layout.Position(cell.Position)
 {
     Margin = cell.Position.Margin.SetLeft(left)
 });
Example #9
0
 public static Grid.Layout.Cell MarginRight(this Grid.Layout.Cell cell,
                                            nfloat right) => new Grid.Layout.Cell(cell.View,
                                                                                  new Grid.Layout.Position(cell.Position)
 {
     Margin = cell.Position.Margin.SetRight(right)
 });
Example #10
0
 /// <summary>
 /// Margin is included in size auto calculation (when a col or row spec is -1).
 /// </summary>
 public static Grid.Layout.Cell Margin(this Grid.Layout.Cell cell, nfloat all) => new Grid.Layout.Cell(cell.View, new Grid.Layout.Position(cell.Position)
 {
     Margin = new UIEdgeInsets(all, all, all, all)
 });
Example #11
0
 public static Grid.Layout.Cell MarginTop(this Grid.Layout.Cell cell,
                                          nfloat top) => new Grid.Layout.Cell(cell.View,
                                                                              new Grid.Layout.Position(cell.Position)
 {
     Margin = cell.Position.Margin.SetTop(top)
 });
Example #12
0
 public static Grid.Layout.Cell ColSpan(this Grid.Layout.Cell cell, int columnspan) => new Grid.Layout.Cell(cell.View, new Grid.Layout.Position(cell.Position)
 {
     ColumnSpan = columnspan
 });
Example #13
0
 /// <summary>
 /// Margin is included in size auto calculation (when a col or row spec is -1).
 /// </summary>
 public static Grid.Layout.Cell Margin(this Grid.Layout.Cell cell, nfloat top, nfloat left, nfloat bottom, nfloat right) => new Grid.Layout.Cell(cell.View, new Grid.Layout.Position(cell.Position)
 {
     Margin = new UIEdgeInsets(top, left, bottom, right)
 });
Example #14
0
 /// <summary>
 /// Margin is included in size auto calculation (when a col or row spec is -1).
 /// </summary>
 public static Grid.Layout.Cell Margin(this Grid.Layout.Cell cell, UIEdgeInsets margin) => new Grid.Layout.Cell(cell.View, new Grid.Layout.Position(cell.Position)
 {
     Margin = margin
 });
Example #15
0
 public static Grid.Layout.Cell Horizontally(this Grid.Layout.Cell cell, Grid.Layout.Alignment alignment) => new Grid.Layout.Cell(cell.View, new Grid.Layout.Position(cell.Position)
 {
     Horizontal = alignment
 });
Example #16
0
 public static Grid.Layout.Cell RowSpan(this Grid.Layout.Cell cell, int rowspan) => new Grid.Layout.Cell(cell.View, new Grid.Layout.Position(cell.Position)
 {
     RowSpan = rowspan
 });
Example #17
0
 /// <summary>
 /// This is an alternative to using Vertically() and/or Horizontally() to set
 /// alignment. It sets one of both directions to Stretched.
 /// </summary>
 public static Grid.Layout.Cell AlignStretch(this Grid.Layout.Cell cell,
                                             Grid.Layout.Direction direction = Grid.Layout.Direction.Both) =>
 Align(cell, Grid.Layout.Alignment.Stretched, direction);
Example #18
0
 public static Grid.Layout.Cell MarginBottom(this Grid.Layout.Cell cell,
                                             nfloat bottom) => new Grid.Layout.Cell(cell.View,
                                                                                    new Grid.Layout.Position(cell.Position)
 {
     Margin = cell.Position.Margin.SetBottom(bottom)
 });
Example #19
0
 /// <summary>
 /// If a View is Hidden or has Alpha set to 0, whether to
 /// skip the view when auto sizing the width and/or height.
 /// </summary>
 public static Grid.Layout.Cell CollapseHidden(this Grid.Layout.Cell cell, Grid.Layout.Collapse collapse) => new Grid.Layout.Cell(cell.View, new Grid.Layout.Position(cell.Position)
 {
     CollapseHidden = collapse
 });
Example #20
0
 /// <summary>
 /// Provides a way to attach a .NET value to the grid cell. Useful for debugging.
 /// </summary>
 public static Grid.Layout.Cell Tag(this Grid.Layout.Cell cell, object tag) => new Grid.Layout.Cell(cell.View, new Grid.Layout.Position(cell.Position)
 {
     Tag = tag
 });