Skip to main content

Class Control

Represents a base class for display controls in the user interface.

Assembly: MicroLayout.dll
View Source
public abstract class Control : IControl

Derived:
Meadow.Foundation.Graphics.MicroLayout.ThemedControl

Implements:
Meadow.Foundation.Graphics.MicroLayout.IControl

Properties

IsInvalid

Gets or sets a value indicating whether the control needs to be redrawn.

View Source
public virtual bool IsInvalid { get; }

Context

Gets or sets the context object associated with the control.

View Source
public object? Context { get; set; }

Parent

Gets of sets the Control's Paretn, if it has one. If the Control is unparented (i.e. Parent is null) then it is directly on the DisplayScreen

View Source
public IControl? Parent { get; set; }

IsVisible

Gets or sets a value indicating whether the control is visible.

View Source
public virtual bool IsVisible { get; set; }

Left

Gets or sets the left coordinate of the control.

View Source
public int Left { get; set; }

Top

Gets or sets the top coordinate of the control.

View Source
public int Top { get; set; }

Width

Gets or sets the width of the control.

View Source
public int Width { get; set; }

Height

Gets or sets the height of the control.

View Source
public int Height { get; set; }

Bottom

Gets the bottom coordinate of the control.

View Source
public int Bottom { get; }

Gets the right coordinate of the control.

View Source
public int Right { get; }

Methods

SetInvalidatingProperty<T>(ref T, T)

Sets a property value and marks the control as invalid, requiring a redraw.

View Source
protected void SetInvalidatingProperty<T>(ref T field, T value)
Parameters
TypeNameDescription
<T>fieldThe reference to the field to set.
<T>valueThe new value to assign to the property.
Type Parameters
NameDescription
TThe type of the property.

Invalidate()

Marks the control as invalid, requiring a redraw.

View Source
public virtual void Invalidate()

Refresh(MicroGraphics)

Refreshes the control by redrawing it on the specified Meadow.Foundation.Graphics.MicroGraphics surface.

View Source
public void Refresh(MicroGraphics graphics)
Parameters
TypeNameDescription
Meadow.Foundation.Graphics.MicroGraphicsgraphicsThe Meadow.Foundation.Graphics.MicroGraphics surface to redraw the control on.

OnDraw(MicroGraphics)

Performs the actual drawing of the control on the specified Meadow.Foundation.Graphics.MicroGraphics surface. This method must be implemented in derived classes.

View Source
protected abstract void OnDraw(MicroGraphics graphics)
Parameters
TypeNameDescription
Meadow.Foundation.Graphics.MicroGraphicsgraphicsThe Meadow.Foundation.Graphics.MicroGraphics surface to draw the control on.

Implements