Interface IWindowControl
- Namespace
- SharpConsoleUI.Controls
- Assembly
- SharpConsoleUI.dll
Represents a UI control that can be displayed within a window or container.
public interface IWindowControl : IDisposable
- Inherited Members
- Extension Methods
Properties
ActualHeight
Gets the actual height at which the control was last rendered. Returns 0 if the control has not been rendered yet.
int ActualHeight { get; }
Property Value
ActualWidth
Gets the actual width at which the control was last rendered. Returns 0 if the control has not been rendered yet.
int ActualWidth { get; }
Property Value
ActualX
Gets the actual X coordinate where the control was last rendered. Returns 0 if the control has not been rendered yet.
int ActualX { get; }
Property Value
ActualY
Gets the actual Y coordinate where the control was last rendered. Returns 0 if the control has not been rendered yet.
int ActualY { get; }
Property Value
Container
Gets or sets the parent container that hosts this control.
IContainer? Container { get; set; }
Property Value
ContentWidth
Gets the minimum width needed to display the control's content, including margins. Returns null if width cannot be determined. This is calculated based on content (text length, child controls, etc.) and represents the natural/intrinsic size.
int? ContentWidth { get; }
Property Value
- int?
Height
Gets or sets the explicit height of the control, or null for automatic sizing.
int? Height { get; set; }
Property Value
- int?
HorizontalAlignment
Gets or sets the horizontal alignment of the control within its container.
HorizontalAlignment HorizontalAlignment { get; set; }
Property Value
Margin
Gets or sets the margin (spacing) around the control.
Margin Margin { get; set; }
Property Value
Name
Gets or sets the unique name identifier for this control, used for lookup.
string? Name { get; set; }
Property Value
StickyPosition
Gets or sets whether this control should stick to the top or bottom during scrolling.
StickyPosition StickyPosition { get; set; }
Property Value
Tag
Gets or sets an arbitrary object value that can be used to store custom data.
object? Tag { get; set; }
Property Value
VerticalAlignment
Gets or sets the vertical alignment of the control within its container.
VerticalAlignment VerticalAlignment { get; set; }
Property Value
Visible
Gets or sets whether this control is visible.
bool Visible { get; set; }
Property Value
Width
Gets or sets the explicit width of the control, or null for automatic sizing.
int? Width { get; set; }
Property Value
- int?
Methods
GetLogicalContentSize()
Gets the logical size of the control's content without rendering.
Size GetLogicalContentSize()
Returns
- Size
The size representing the content's natural dimensions.
Invalidate()
Marks this control as needing to be re-rendered.
void Invalidate()