In This Article

ThemeDefinition Class

Stores the configuration options for a generated theme.

public class ThemeDefinition : ObservableObjectBase
Inheritance:
object ObservableObjectBase object

Constructors

ThemeDefinition()

Initializes an instance of the class.

public ThemeDefinition()

Properties

AccentColorRampName

The name of the accent color ramp in the ColorPalette.

public string AccentColorRampName { get; set; }

Property Value

string:

The default value is "Blue".

BadgeAppearanceKind

The BadgeAppearanceKind that indicates the default appearance for Badge controls.

public BadgeAppearanceKind BadgeAppearanceKind { get; set; }

Property Value

BadgeAppearanceKind:

The default value is Solid.

BaseFontSize

The font size that is used as a basis for building font size ramps.

public double BaseFontSize { get; set; }

Property Value

double:

The default value is 14.0.

ButtonAppearanceKind

The ButtonAppearanceKind that indicates the default appearance for various button controls (e.g., Avalonia.Controls.Button, Avalonia.Controls.SplitButton).

public ButtonAppearanceKind ButtonAppearanceKind { get; set; }

Property Value

ButtonAppearanceKind:

The default value is Outline.

CardAppearanceKind

The CardAppearanceKind that indicates the default appearance for Card controls.

public CardAppearanceKind CardAppearanceKind { get; set; }

Property Value

CardAppearanceKind:

The default value is Outline.

CheckBoxAppearanceKind

The SwitchAppearanceKind that indicates the default appearance for Avalonia.Controls.CheckBox controls.

public SwitchAppearanceKind CheckBoxAppearanceKind { get; set; }

Property Value

SwitchAppearanceKind:

The default value is Outline.

CheckBoxCornerRadius

The corner radius for checkboxes.

public double CheckBoxCornerRadius { get; set; }

Property Value

double:

The default value is 2.0.

CodeFontFamily

The Avalonia.Media.FontFamily used for code listings, typically a monospace font.

public FontFamily CodeFontFamily { get; set; }

Property Value

FontFamily:

The default value is Cascadia Code, Consolas, Menlo, Monaco, Roboto Mono, DejaVu Sans Mono, $Default.

DangerColorRampName

The name of the danger accent color ramp in the ColorPalette.

public string DangerColorRampName { get; set; }

Property Value

string:

The default value is "Red".

DefaultFontFamily

The Avalonia.Media.FontFamily used by default.

public FontFamily DefaultFontFamily { get; set; }

Property Value

FontFamily:

The default value is Segoe UI, Helvetica Neue, fonts:Inter#Inter, $Default.

EditAppearanceKind

The EditAppearanceKind that indicates the default appearance for various edit controls (e.g., Avalonia.Controls.ComboBox, Avalonia.Controls.TextBox).

public EditAppearanceKind EditAppearanceKind { get; set; }

Property Value

EditAppearanceKind:

The default value is Outline.

Generator

The ThemeGenerator to use when generating theme resources with this definition.

public ThemeGenerator? Generator { get; set; }

Property Value

ThemeGenerator:

The default value is null.

Remarks

This property only needs to be set if a customized ThemeGenerator is required.

HeadingFontFamily

The Avalonia.Media.FontFamily used by headings.

public FontFamily HeadingFontFamily { get; set; }

Property Value

FontFamily:

The default value is Segoe UI, Helvetica Neue, fonts:Inter#Inter, $Default.

InformationColorRampName

The name of the information accent color ramp in the ColorPalette.

public string InformationColorRampName { get; set; }

Property Value

string:

The default value is "Cyan".

MenuItemIconColumnWidth

The width for menu item icon columns.

public double MenuItemIconColumnWidth { get; set; }

Property Value

double:

The default value is 30.0.

MenuItemPopupColumnWidth

The width for menu item popup columns.

public double MenuItemPopupColumnWidth { get; set; }

Property Value

double:

The default value is 30.0.

NeutralColorRampName

The name of the neutral (e.g., grayscale) color ramp in the ColorPalette.

public string NeutralColorRampName { get; set; }

Property Value

string:

The default value is "Neutral".

RadioButtonAppearanceKind

The SwitchAppearanceKind that indicates the default appearance for Avalonia.Controls.RadioButton controls.

public SwitchAppearanceKind RadioButtonAppearanceKind { get; set; }

Property Value

SwitchAppearanceKind:

The default value is Outline.

ScrollBarThumbMarginAscent

The ascent for scroll bar thumb margins, which is the margin space around the short end of the thumb.

public double ScrollBarThumbMarginAscent { get; set; }

Property Value

double:

The default value is 0.0.

See Also

ScrollBarThumbMarginExtent

The extent for scroll bar thumb margins, which is the margin space around the long end of the thumb.

public double ScrollBarThumbMarginExtent { get; set; }

Property Value

double:

The default value is 3.0.

See Also

ScrollBarThumbMaxAscent

The maximum ascent for scroll bar thumbs, which is the maximum thickness of the thumb given the current thumb margin settings.

public double ScrollBarThumbMaxAscent { get; set; }

Property Value

double:

The default value is 4.0.

See Also

ScrollBarThumbMinAscent

The minimum ascent for scroll bar thumbs, which is the minimum thickness of the thumb given the current thumb margin settings.

public double ScrollBarThumbMinAscent { get; set; }

Property Value

double:

The default value is 4.0.

See Also

SegmentedBarAppearanceKind

The SegmentedBarAppearanceKind that indicates the default appearance for SegmentedBar controls.

public SegmentedBarAppearanceKind SegmentedBarAppearanceKind { get; set; }

Property Value

SegmentedBarAppearanceKind:

The default value is Elevated.

SliderAppearanceKind

The SwitchAppearanceKind that indicates the default appearance for Avalonia.Controls.Slider controls.

public SwitchAppearanceKind SliderAppearanceKind { get; set; }

Property Value

SwitchAppearanceKind:

The default value is Outline.

SpinnerHasHorizontalOrientation

Whether spinner buttons should use a horizontal orientation.

public bool SpinnerHasHorizontalOrientation { get; set; }

Property Value

bool:

The default value is false.

SuccessColorRampName

The name of the success accent color ramp in the ColorPalette.

public string SuccessColorRampName { get; set; }

Property Value

string:

The default value is "Green".

SwitchBorderWidth

The border width for checkbox and radio button controls.

public double SwitchBorderWidth { get; set; }

Property Value

double:

The default value is 1.0.

SwitchScale

The scale factor for checkbox and radio button controls.

public double SwitchScale { get; set; }

Property Value

double:

The default value is 1.05, meaning 105%.

TabAppearanceKind

The TabAppearanceKind that indicates the default appearance for various tab controls (e.g., Avalonia.Controls.TabControl).

public TabAppearanceKind TabAppearanceKind { get; set; }

Property Value

TabAppearanceKind:

The default value is Outline.

ToggleSwitchAppearanceKind

The SwitchAppearanceKind that indicates the default appearance for Avalonia.Controls.ToggleSwitch controls.

public SwitchAppearanceKind ToggleSwitchAppearanceKind { get; set; }

Property Value

SwitchAppearanceKind:

The default value is Outline.

ToggleSwitchHasFarAffinity

Whether Avalonia.Controls.ToggleSwitch controls should have far affinity.

public bool ToggleSwitchHasFarAffinity { get; set; }

Property Value

bool:

The default value is false.

UseAccentedSwitches

Whether to use the theme accent color for toggled switch controls.

public bool UseAccentedSwitches { get; set; }

Property Value

bool:

The default value is false.

UserInterfaceDensity

The UserInterfaceDensity that indicates the density of the user interface.

public UserInterfaceDensity UserInterfaceDensity { get; set; }

Property Value

UserInterfaceDensity:

The default value is Normal.

WarningColorRampName

The name of the warning accent color ramp in the ColorPalette.

public string WarningColorRampName { get; set; }

Property Value

string:

The default value is "Orange".

Inherited Members

Extension Methods