New to Telerik Document Processing? Start a free 30-day trial

Style

Class

Defines a named set of formatting properties that can be reused across multiple document elements with inheritance support.

Definition

Namespace:Telerik.Documents.Flow.Model.Styles

Assembly:Telerik.Windows.Documents.Flow.dll

Syntax:

C#
public class Style

Inheritance: objectStyle

Constructors

Creates a new style with the specified identifier and type.

C#
public Style(string id, StyleType type)
Parameters:idstring

The ID.

typeStyleType

The type.

Properties

Gets or sets the style ID from which this style inherits formatting properties.

C#
public string BasedOnStyleId { get; set; }
Property Value:

The name of the based on.

Gets the character formatting properties applied by this style to text runs.

C#
public CharacterProperties CharacterProperties { get; }
Property Value:

The character properties.

Gets the document that owns this style, or null if the style has not been added to a document.

C#
public RadFlowDocument Document { get; }
Property Value:

The document.

Gets or sets the unique identifier for this style; cannot be changed once the style is added to a document.

C#
public string Id { get; set; }
Property Value:

The ID.

Gets or sets whether this style is user-defined rather than built-in; defaults to false. The default value is

csharp
false

.

C#
public bool IsCustom { get; set; }

Gets or sets whether this style serves as the default for its type; cannot be changed once added to a document.

C#
public bool IsDefault { get; set; }
Property Value:

The is default.

Gets or sets whether this style appears in the primary styles gallery in UI.

C#
public bool IsPrimary { get; set; }

Gets or sets the linked style ID that pairs this paragraph style with a character style or vice versa.

This property can be set to Paragraph or Character style only. Paragraph style can be linked only to Character style and vice versa.

C#
public string LinkedStyleId { get; set; }
Property Value:

The linked style ID.

Gets or sets the display name shown in UI; defaults to the style ID if not explicitly set.

C#
public string Name { get; set; }
Property Value:

The name.

Gets or sets the style ID automatically applied to the next paragraph after pressing Enter.

C#
public string NextStyleId { get; set; }
Property Value:

The next style id.

Gets the paragraph formatting properties applied by this style to paragraphs.

C#
public ParagraphProperties ParagraphProperties { get; }
Property Value:

The paragraph properties.

Gets the category of document elements to which this style applies.

C#
public StyleType StyleType { get; }
Property Value:

The type of the style.

Gets the table cell formatting properties; only populated for table styles.

C#
public TableCellProperties TableCellProperties { get; }
Property Value:

The table cell properties.

Gets the table formatting properties; only populated for table styles.

C#
public TableProperties TableProperties { get; }
Property Value:

The table properties.

Gets the table row formatting properties; only populated for table styles.

C#
public TableRowProperties TableRowProperties { get; }
Property Value:

The table row properties.

Gets or sets the sort order priority for displaying this style in UI lists; lower values appear first.

C#
public int UIPriority { get; set; }
Property Value:

The UI priority.

Methods

Creates a deep copy of this style with all properties and settings preserved.

C#
public Style Clone()
Returns:

Style

The cloned style.

Retrieves the resolved value of a style property by evaluating the inheritance chain.

C#
public object GetPropertyValue(IStylePropertyDefinition stylePropertyDefinition)
Parameters:stylePropertyDefinitionIStylePropertyDefinition

The style property definition.

Returns:

object