Class
Theme

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:

cs-api-definition
public class Theme

Inheritance: objectTheme

Constructors

Theme()

Declaration

cs-api-definition
public Theme()

Theme(string)

Declaration

cs-api-definition
public Theme(string name)

Parameters

name

string

Properties

Name

Gets or sets the name of the theme.

Declaration

cs-api-definition
[XamlSerializable("Office Theme")]
public string Name { get; set; }

Property Value

string

A string representing the name of the theme.

ThemeColorMapping

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

Declaration

cs-api-definition
[XamlCompositePropertySerializable]
public ThemeColorMapping ThemeColorMapping { get; set; }

Property Value

ThemeColorMapping

ThemeColors

Gets the collection of theme colors associated with the theme.

Declaration

cs-api-definition
[XamlCompositePropertySerializable]
public ThemeColors ThemeColors { get; set; }

Property Value

ThemeColors

ThemeFonts

Gets the fonts that are defined in the theme.

Declaration

cs-api-definition
[XamlCompositePropertySerializable]
public ThemeFonts ThemeFonts { get; set; }

Property Value

ThemeFonts

Methods

GetColor(ThemeColorsEnum, out Color)

Retrieves the color associated with the specified theme color enumeration.

Declaration

cs-api-definition
public bool GetColor(ThemeColorsEnum themeColorsEnum, out Color color)

Parameters

themeColorsEnum

ThemeColorsEnum

The theme color enumeration to retrieve the associated color for.

color

Color

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.

GetColorFromHex(string)

Retrieves the color associated with the specified hexadecimal color string.

Declaration

cs-api-definition
public static Color GetColorFromHex(string hexValue)

Parameters

hexValue

string

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

Returns

Color

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

GetFont(ThemeFontsEnum, out FontFamily)

Retrieves the font associated with the specified theme font enumeration.

Declaration

cs-api-definition
public bool GetFont(ThemeFontsEnum themeFont, out FontFamily fontFamily)

Parameters

themeFont

ThemeFontsEnum

The theme font enumeration indicating which font to retrieve.

fontFamily

FontFamily

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.