EmptyState class Core
What a place shows while it has nothing to show: an icon in a tinted circle, a title, a line that says what to do, and the action that does it ("New order") - centred in its slot. The action is a Button of its own: focusable, styled, read as a button.
Styling. From the style sheets (Select.Type<EmptyState>()): the circle's fill (background), the icon's colour (accent colour), and the title's colour, size, weight and family; the line under it reads in the theme's dim text, the action is a primary button.
public sealed class EmptyState : Control
- Namespace
- ArionUI.Presentation.Controls
- Package
- ArionUI.Presentation ·
dotnet add package ArionUI.Presentation --prerelease - Inherits
- Control
Constructors
EmptyState
public EmptyState(Func<string> title, Func<string> text, Func<string>? action = null, Action? click = null);A place with nothing to show.
Parameters
titleThe title ("No order selected").
textWhat to do ("Pick an order on the left to edit it.").
actionThe action's caption; null for no action.
clickWhat the action does.
Properties
Action
public Button? Action { get; }The action, to reach it from the application (its focus, its id); null without one.
Children
public override IEnumerable<Control> Children { get; }The controls inside this one, in tree order (visual order, tab order). A host keeps the tree it adopted: a control whose children change once it is adopted says so with Control.TreeChanged (on a shown board inside Board.Mutate), or its new children get no host and Tab, ticks and the wheel do not find them.
Icon
public Action<IRenderSurface, LogRect, Rgba>? Icon { get; init; }The icon in the circle; null draws the circle empty.
Role
public override ControlRole Role { get; }What KIND of part this is for assistive technology — the automation peers translate it into their host's control type.
Title
public Func<string> Title { get; }The title, asked each time it is drawn.
Methods
Arrange
public override void Arrange(LogRect bounds);
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.