Skip to main content

Class Control

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

Assembly: MicroLayout.dll
View Source
Declaration
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
Declaration
public virtual bool IsInvalid { get; }

Context

Gets or sets the context object associated with the control.

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

Parent

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

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

IsVisible

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

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

Left

Gets or sets the left coordinate of the control.

View Source
Declaration
public virtual int Left { get; set; }

Top

Gets or sets the top coordinate of the control.

View Source
Declaration
public virtual int Top { get; set; }

Width

Gets or sets the width of the control.

View Source
Declaration
public virtual int Width { get; set; }

Height

Gets or sets the height of the control.

View Source
Declaration
public virtual int Height { get; set; }

Bottom

Gets the bottom coordinate of the control.

View Source
Declaration
public virtual int Bottom { get; }

Gets the right coordinate of the control.

View Source
Declaration
public virtual int Right { get; }

Methods

SetInvalidatingProperty<T>(ref T, T)

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

View Source
Declaration
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
Declaration
public virtual void Invalidate()

Refresh(MicroGraphics)

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

View Source
Declaration
public void Refresh(MicroGraphics graphics)
Parameters
TypeNameDescription
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
Declaration
protected abstract void OnDraw(MicroGraphics graphics)
Parameters
TypeNameDescription
Meadow.Foundation.Graphics.MicroGraphics surface to draw the control on.

Implements