New to Telerik UI for WPF? Start a free 30-day trial

Theme

Class

Represents a theme in the Telerik Document Model. A theme defines the visual styling of documents, including colors, fonts, and other UI elements.

Definition

Namespace:Telerik.Windows.Documents.Model.Themes

Assembly:Telerik.Windows.Controls.RichTextBox.dll

Syntax:

C#
public class Theme

Inheritance: objectTheme

Constructors

C#
public Theme()
C#
public Theme(string name)
Parameters:namestring

Properties

Gets or sets the name of the theme.

C#
[XamlSerializable("Office Theme")]
public string Name { get; set; }
Property Value:

A string representing the name of the theme.

Represents the color mapping for a theme in Telerik's document model.

C#
[XamlCompositePropertySerializable]
public ThemeColorMapping ThemeColorMapping { get; set; }

Gets the collection of theme colors associated with the theme.

C#
[XamlCompositePropertySerializable]
public ThemeColors ThemeColors { get; set; }

Gets the fonts that are defined in the theme.

C#
[XamlCompositePropertySerializable]
public ThemeFonts ThemeFonts { get; set; }

Methods

Retrieves the color associated with the specified theme color enumeration.

C#
public bool GetColor(ThemeColorsEnum themeColorsEnum, out Color color)
Parameters:themeColorsEnumThemeColorsEnum

The theme color enumeration to retrieve the associated color for.

colorColor

When this method returns, contains the Color associated with the specified theme color.

Returns:

bool

Returns true if the color was successfully retrieved; otherwise, false.

Retrieves the color associated with the specified hexadecimal color string.

C#
public static Color GetColorFromHex(string hexValue)
Parameters:hexValuestring

A string representing the color in hexadecimal format (e.g., "#FFFFFF").

Returns:

Color

A Color object that corresponds to the provided hexadecimal color string.

Retrieves the font associated with the specified theme font enumeration.

C#
public bool GetFont(ThemeFontsEnum themeFont, out FontFamily fontFamily)
Parameters:themeFontThemeFontsEnum

The theme font enumeration indicating which font to retrieve.

fontFamilyFontFamily

When this method returns, contains the FontFamily associated with the specified font enumeration.

Returns:

bool

Returns a boolean value indicating whether the font was successfully retrieved.