Drawing class Core

A leaf the application paints itself (a mark, a chip, a tile), the control-tree counterpart of a composition's draw element. Never focusable, hit-transparent.

public sealed class Drawing : Control
Namespace
ArionUI.Presentation.Controls
Package
ArionUI.Presentation · dotnet add package ArionUI.Presentation --prerelease
Inherits
Control

Constructors

Drawing

public Drawing();

Properties

Height

public double Height { get; init; }

Desired height, fixed.

HeightFor

public Func<double, double>? HeightFor { get; init; }

Desired height for a given width, when the drawing flows (a row of chips that wraps); wins over Drawing.Height.

Paint

public required Action<IRenderSurface, LogRect> Paint { get; init; }

Role

public override ControlRole Role { get; }

A drawing is read through its Control.AccessibleName ("2,000 rows", "Preview"); without one it is decoration, which a reader skips.

Width

public double? Width { get; init; }

Desired width; null takes the available width.

Methods

HitTest

public override Control? HitTest(LogPoint p);

The control under an ABSOLUTE point, or null. Containers recurse; leaves answer for themselves. Same bounds the render pass used.

Measure

public override LogSize Measure(LogSize available);

Desired size given the space available (layout containers sum this).

Render

public override void Render(IRenderSurface s, ControlFrame frame);

SpokenLabel

public override string? SpokenLabel();

What a screen reader speaks when this control receives the focus. A control that cannot take the focus but answers here is READ: it becomes a text part.