Skip to content

IAppearanceService interface

Lists the appearance choices an application offers and applies the chosen one.

public interface IAppearanceService : INotifyPropertyChanged

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.
SelectedTheme { get; set; } The chosen variant. Assigning it recolours the running application at once.
Themes { 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 SelectedTheme 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.

See Also