Class Dim
Describes a declarative, responsive dimension for a View. Dim is the type of Width and Height. Integer values are implicitly convertible to an absolute Dim.
public abstract record Dim : IEqualityOperators<Dim, Dim, bool>, IEquatable<Dim>
- Inheritance
-
Dim
- Implements
- Derived
- Inherited Members
Remarks
To make a view's size respond to the available space, its content, or the size and position of other views rather than using a fixed number of cells, use Dim.
To define responsive sizing in Terminal.Gui, describe the relationship that should be maintained and let the layout engine resolve the final Frame whenever layout runs.
| Dim Object | Description |
|---|---|
| Absolute(int) | Creates a Dim that is a fixed size. |
| Auto(DimAutoStyle, Dim?, Dim?) | Creates a Dim object that automatically sizes the view to fit the view's Text, SubViews, or ContentArea. |
| Func(Func<View?, int>, View?) | Creates a Dim object that computes the dimension by executing the provided function. The function will be called every time the dimension is needed. |
| Percent(int, DimPercentMode) | Creates a Dim object that is a percentage of the width or height of the SuperView. |
| Fill(Dim) | Creates a Dim object that fills the dimension from the View's X position to the end of the super view's width, leaving the specified number of columns for a margin. |
| Width(View?) | Creates a Dim object that tracks the Width of the specified View. |
| Height(View?) | Creates a Dim object that tracks the Height of the specified View. |
Constructors
Properties
Methods
- Absolute(int)
Creates an Absolute Dim from the specified integer value.
- Auto(DimAutoStyle, Dim?, Dim?)
Creates a Dim object that automatically sizes the view to fit all the view's Content, SubViews, and/or Text.
- Fill(Dim, Dim?)
Creates a Dim object that fills the dimension, leaving the specified margin and respecting the specified minimum dimension.
- Fill(Dim, Dim?, View)
Creates a Dim object that fills the dimension up to the position of another view, with a margin and minimum dimension.
- Fill(Dim, View)
Creates a Dim object that fills the dimension up to the position of another view, with a margin.
- Fill(View)
Creates a Dim object that fills the dimension up to the position of another view.
- Func(Func<View?, int>, View?)
Creates a function Dim object that computes the dimension based on the passed view and by executing the provided function. The function will be called every time the dimension is needed.
- HasInner<TDim>(out TDim)
Searches nested Dim objects for the specified type. Override in subclasses that contain other Dim objects to enable Has<TDim>(out TDim) to find nested types.
- Has<TDim>(out TDim)
Indicates whether the specified type
TDimis in the hierarchy of this Dim object.
- Height(View?)
Creates a Dim object that tracks the Height of the specified View.
- Percent(int, DimPercentMode)
Creates a percentage Dim object that is a percentage of the width or height of the SuperView.
- Width(View?)
Creates a Dim object that tracks the Width of the specified View.
Operators
- implicit operator Dim(int)
Creates an Absolute Dim from the specified integer value.