SearchBox class Core

A search field: a TextBox with the magnifier at its start and a placeholder, reporting every change of its text. It composes the text box - typing, the caret, the edit menu, the clipboard and the reader all are the text box's own.

Styling. The text box inside carries the class search (Select.Type<TextBox>().Class("search")): the theme draws it 36 units tall on the input fill (Tokens.EditBackground), with a hairline border rounded by 9 that takes the accent while it holds the focus. The magnifier takes the dim text colour.

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

Constructors

SearchBox

public SearchBox();

Properties

Box

public TextBox Box { get; }

The text box inside, which holds the text, the caret and the focus.

Cancelled

public Action? Cancelled { get; init; }

Escape; null lets the key go on (a pane closes).

Changed

public Action<string>? Changed { get; init; }

The text changed through typing or an edit key; gets the new text.

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.

Committed

public Action? Committed { get; init; }

Enter.

Height

public double Height { get; init; }

The height the field asks for.

Placeholder

public LocalText Placeholder { get; init; }

Shown dimmed while the field is empty; it is also what a reader calls the field.

Text

public string Text { get; set; }

The text searched for. Setting it does not raise SearchBox.Changed.

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);