VegaRise.NET
Back to DOM

BaseDocumentStyleClass

Definition

Namespace
DOM.Styles
Assembly
DOM.dll

Base container for document-level default style settings.

Remarks

centralizes the common default styles that apply across a document (for example the default paragraph and text/character styles). Implementations and consumers can read or override these defaults when creating new document elements so they follow a consistent appearance. BaseDocumentStyle Both and are nullable to allow callers to selectively override only the style categories they need. When a style is, the rendering/serialization layer should fall back to library-wide defaults or parent style inheritance. ParagraphStyle TextStyle null

Examples

csharp
1// 1. Provide both default paragraph and text styles
2var defaults = new BaseDocumentStyle
3{
4 ParagraphStyle = new ParagraphStyle { Justification = JustificationValues.Left },
5 TextStyle = new TextStyle
6 {
7 Font = new Font { Latin = new FontPart { FontName = "Calibri", Size = 11.0 } }
8 }
9};
10
csharp
1// 2. Override only the default text style
2var defaults = new BaseDocumentStyle
3{
4 TextStyle = new TextStyle
5 {
6 Font = new Font
7 {
8 Latin = new FontPart { FontName = "Segoe UI", Size = 12.0 },
9 Color = Color.DarkSlateGray
10 }
11 }
12};
13
csharp
1// 3. Override only the default paragraph style
2var defaults = new BaseDocumentStyle
3{
4 ParagraphStyle = new ParagraphStyle
5 {
6 SpacingBetweenLines = new Spacing { After = 8, Line = 1.15 }
7 }
8};
9
csharp
1// 4. Assign the defaults to the document
2doc.DocumentStyles.DocumentDefualtStyles = new DocumentDefualtStyles
3{
4 TextStyle = new TextStyle { Font = new Font("Calibri", 11.0) },
5 ParagraphStyle = new ParagraphStyle()
6};
7
csharp
1// 5. Rely on fallbacks (both properties null)
2var defaults = new BaseDocumentStyle();
3// The consumer uses the library-wide default for both paragraph and text styles.
4

Properties

ParagraphStyleIParagraphStyle

Gets or sets the default paragraph style applied when creating new paragraphs.

When, consumers should fall back to library-wide defaults or to the parent style in the style inheritance chain. null

TextStyleITextStyle

Gets or sets the default text (character) style applied when creating new text runs.

VegaRiseVDocs.NET

Reset Password

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

Remember your password? Sign in