#nullable enable namespace Terminal.Gui.ViewBase; /// /// Represents a function object that computes the dimension based on the passed view and by /// executing the provided function. /// /// /// This is a low-level API that is typically used internally by the layout system. Use the various static /// methods on the class to create objects instead. /// /// The function that computes the dimension. If this function throws ... /// The returned from the function based on the passed view. public record DimFunc (Func Fn, View? View = null) : Dim { /// /// Gets the function that computes the dimension. /// public Func Fn { get; } = Fn; /// /// Gets the passed view that the dimension is based on. /// public View? View { get; } = View; /// public override string ToString () { return $"DimFunc({Fn (View)})"; } internal override int GetAnchor (int size) { return Fn (View); } }