Method Auto
Auto(DimAutoStyle, Dim?, Dim?)
Creates a Dim object that automatically sizes the view to fit all the view's Content, Subviews, and/or Text.
public static Dim? Auto(DimAutoStyle style = DimAutoStyle.Auto, Dim? minimumContentDim = null, Dim? maximumContentDim = null)
Parameters
style
DimAutoStyleSpecifies how Auto(DimAutoStyle, Dim?, Dim?) will compute the dimension. The default is Auto.
minimumContentDim
DimThe minimum dimension the View's ContentSize will be constrained to.
maximumContentDim
DimThe maximum dimension the View's ContentSize will be fit to.
Returns
Examples
This initializes a View with two SubViews. The view will be automatically sized to fit the two SubViews.
var button = new Button () { Text = "Click Me!", X = 1, Y = 1, Width = 10, Height = 1 };
var textField = new TextField { Text = "Type here", X = 1, Y = 2, Width = 20, Height = 1 };
var view = new Window () { Title = "MyWindow", X = 0, Y = 0, Width = Dim.Auto (), Height = Dim.Auto () };
view.Add (button, textField);
Remarks
See DimAutoStyle.