Skip to main content

Controls

ToolkitTheme restyles Avalonia's own controls, such as Button, TextBox, ComboBox, ListBox, TreeView and TabControl, so they need nothing more than the theme. HammerUI adds controls Avalonia does not have, for the panels, inspectors and editors of desktop tools. All of them are in the https://github.com/runesmithhub/hammerui XAML namespace, written ui: on these pages, and in the HammerUI.Controls namespace in C#.

PageControls
Buttons and badgesButton classes, tool toggles, Badge, ShortcutBadge, SegmentedControl, filter chips.
Inputs and fieldsNumberField, Vector2Field, SearchBox, PathField, input filters and validation messages.
PropertiesPropertyGroup, PropertyRow and the shared label column.
ColorsColorPickerButton, ColorPicker, ColorSwatch, ColorSwatchPicker.
Curves and gradientsCurvePreview, CurveEditor, GradientPreview, GradientEditor and the values they edit.
Feedback and empty statesEmptyState, Sparkline, status icons and drop indicators.
Layout helpersSectionPanel, SettingRow, SplitBar.
Data displayAssetTile grids, lists and trees.

Every control is in the gallery, in both themes.

Edits and undo​

Controls that are edited by dragging, such as number fields, curve editors and gradient bars, raise EditStarted when a drag or a typed edit begins and EditCompleted when it ends. Between them the value changes many times. Group those changes into one undo step: open the step on EditStarted and close it on EditCompleted.

ValueEdit has the same events as routed events, so one handler on a panel covers every field in it:

ValueEdit.AddStartedHandler(inspector, (_, _) => history.BeginGroup());
ValueEdit.AddCompletedHandler(inspector, (_, _) => history.EndGroup());