VegaRise.NET
Back to DOM

ThemeClass

Definition

Namespace
DOM.Styles
Assembly
DOM.dll

Represents a named theme that groups font, format and color scheme resources for a document.

Remarks

provides a single container for visual resources that can be applied consistently across a document (fonts, fills/lines/effects and color palettes). Consumers should consult the theme when producing styled content or when offering theme selection to end users. The flag can be used by higher-level logic to mark which theme is currently applied. Theme IsActive Themes are registered on and activated through . Themes VDocs.SetActiveTheme(name)

Examples

csharp
1// 1. Minimal theme with a name only
2var theme = new Theme { Name = "Office" };
3
csharp
1// 2. Theme with a custom font scheme
2var theme = new Theme
3{
4 Name = "Corporate",
5 Fonts = new FontScheme
6 {
7 Name = "Corporate",
8 MajorLatin = "Calibri Light",
9 MinorLatin = "Calibri"
10 }
11};
12
csharp
1// 3. Theme with a format scheme (fills/lines/effects)
2var theme = new Theme
3{
4 Name = "Modern",
5 FormatSchema = new FormatScheme
6 {
7 Name = "Modern",
8 FillStyleList = new List<BaseFill> { new Fill { SolidFill = new Color("#2196F3") } }
9 }
10};
11
csharp
1// 4. Attach a colour scheme
2var theme = new Theme
3{
4 Name = "Brand",
5 Colors = new ColorScheme { Accent1 = new Color("#1E88E5"), Accent2 = new Color("#FF9800") }
6};
7
csharp
1// 5. Register and activate the theme
2doc.DocumentStyles.Themes = new List<ITheme> { theme };
3doc.SetActiveTheme("Brand");
4

Properties

Gets or sets the color scheme associated with the theme.

Gets or sets the font scheme for this theme.

FormatSchemaIFormatScheme

Gets or sets the format scheme that groups fills, lines and effect presets.

IsActive

Gets or sets a value indicating whether this theme is currently active for the document.

Name

Gets or sets the theme's display name.

VegaRiseVDocs.NET

Reset Password

Enter your email and we'll send you a link to reset your password.

Remember your password? Sign in