ElementTile class Core

A cell composition as a control - a sparkline, a bullet, a donut or any other SlotEl - drawn from one data item: new ElementTile(Cell.Sparkline<Kpi>(k => k.History), kpi) { Height = 48 }. The same drawing a grid cell shows, so a dashboard tile and a table column look alike. Never focusable.

Under the pointer it reacts as the grid cell does: an element with data points marks the one under the pointer (the guide and dot of a sparkline, the column of a column sparkline, the segment of a donut), and ElementTile.Tooltip names it through the grid's tooltip. Built from a chart column (Controls.ElementTile), the tile takes that column's tooltip and spoken text as well.

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

Constructors

ElementTile

public ElementTile(SlotEl element, object item);

Parameters

element

What to draw (built with the Cell factories).

item

The data item the element's accessors read.

ElementTile

public ElementTile(IColumnDefinition column, object item);

The cell of a column built by Column as a tile, for one item: the drawing, the tooltip naming the data point under the pointer and the spoken text are the ones the grid shows for that column - new ElementTile(Column.Sparkline<Kpi>("Revenue", k => k.History), kpi) { Height = 48 }.

Parameters

column

A column whose cell is a composition (the chart columns).

item

The row the cell shows, of the column's row type.

Properties

Height

public double Height { get; init; }

Desired height; 0 takes the element's own (its fixed height or one line).

Role

public override ControlRole Role { get; }

Text to read when it has a name, decoration otherwise.

Tooltip

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

The hover text for the data point under the pointer (-1 when the pointer names none, or the element has no points), shown through the grid's tooltip; null or empty shows none.

Width

public double? Width { get; init; }

Desired width; null takes the width it is given, or the element's own when there is no limit.

Methods

HitTest

public override Control? HitTest(LogPoint p);

Hit only where it reacts to the pointer (data points or a tooltip); otherwise the pointer falls through to the tile's container.

Measure

public override LogSize Measure(LogSize available);

The given width (or ElementTile.Width, or the element's own without a limit) by ElementTile.Height (or the element's own).

OnPointerLeft

public override void OnPointerLeft();

The pointer left: a mark it leaves behind goes.

OnPointerMoved

public override void OnPointerMoved(LogPoint p, bool buttonDown);

Follows the pointer and repaints the tile when it names another data point - not on every move.

Render

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

Draws the element into the bounds, as a grid cell would - with the point under the pointer marked, resolved from the data as it is now, so the mark follows values that change while the pointer rests.

SpokenLabel

public override string? SpokenLabel();

The Control.AccessibleName, asked each time.