Method Fill
Fill()
Creates a Dim object that fills the dimension, leaving no margin.
public static Dim Fill()
Returns
- Dim
The Fill dimension.
Examples
var view = new View { X = 5, Y = 0, Width = Dim.Fill(), Height = 1 };
// If SuperView width is 80, view width will be 75 (80 - 5)
Remarks
The view will fill from its position to the end of the SuperView's content area.
Fill(Dim)
Creates a Dim object that fills the dimension, leaving the specified margin.
public static Dim Fill(Dim margin)
Parameters
marginDimMargin to use.
Returns
- Dim
The Fill dimension.
Examples
var view = new View { X = 0, Y = 0, Width = Dim.Fill(2), Height = 1 };
// If SuperView width is 80, view width will be 78 (80 - 2)
Fill(Dim, Dim?)
Creates a Dim object that fills the dimension, leaving the specified margin and respecting the specified minimum dimension.
public static Dim Fill(Dim margin, Dim? minimumContentDim)
Parameters
marginDimMargin to use.
minimumContentDimDimThe minimum dimension. If null, no minimum is enforced.
Returns
- Dim
The Fill dimension.
Examples
// Fill with minimum width of 40
var view = new View { X = 0, Y = 0, Width = Dim.Fill(margin: 0, minimumContentDim: 40), Height = 1 };
// If SuperView has Dim.Auto() width, it will be at least 40 wide
// If SuperView is 80 wide, view will be 80 wide
// If SuperView is 30 wide, view will still be 40 wide (minimum)
Remarks
When the SuperView uses Auto(DimAutoStyle, Dim?, Dim?), the minimumContentDim will contribute
to the auto-sizing calculation, ensuring the SuperView is at least large enough to accommodate the minimum.