IAppearanceService interface¶
Lists the appearance choices an application offers and applies the chosen one.
Namespace: Eremex.AvaloniaUI.Controls.ApplicationServices
Assembly: Eremex.Common.Contracts.dll
NuGet Package: Eremex.Common.Contracts
Declaration¶
Members¶
| name | description |
|---|---|
| Densities { get; } | The layout densities on offer, from the most compact to the most spacious. Empty when the current theme has no densities. |
| Palettes { get; } | The colour palettes on offer. Empty when the current theme has no palettes. |
| SelectedDensity { get; set; } | The chosen density. Assigning it resizes the controls of the running application at once: paddings, row heights and the like follow the density, the colours do not change. |
| SelectedPalette { get; set; } | The chosen palette. Assigning it recolours the running application at once. |
| SelectedThemeVariant { get; set; } | The chosen variant. Assigning it recolours the running application at once. |
| ThemeVariants { get; } | The light/dark variants on offer, normally the system default plus an explicit light and dark. |
Remarks¶
Meant to be bound straight to a selector — a ribbon gallery, a combo box, a menu: assigning SelectedThemeVariant or SelectedPalette applies the change immediately, so a view model needs no code of its own beyond exposing this service.
Which palettes and densities exist depends on the theme in use; a theme that offers neither simply reports empty Palettes and Densities lists.