Class
Style

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

Definition

Namespace:Telerik.Windows.Documents.Flow.Model.Styles

Assembly:Telerik.Windows.Documents.Flow.dll

Syntax:

cs-api-definition
public class Style

Inheritance: objectStyle

Constructors

Style(string, StyleType)

Creates a new style with the specified identifier and type.

Declaration

cs-api-definition
public Style(string id, StyleType type)

Parameters

id

string

The ID.

type

StyleType

The type.

Properties

BasedOnStyleId

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

Declaration

cs-api-definition
public string BasedOnStyleId { get; set; }

Property Value

string

The name of the based on.

CharacterProperties

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

Declaration

cs-api-definition
public CharacterProperties CharacterProperties { get; }

Property Value

CharacterProperties

The character properties.

Document

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

Declaration

cs-api-definition
public RadFlowDocument Document { get; }

Property Value

RadFlowDocument

The document.

Id

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

Declaration

cs-api-definition
public string Id { get; set; }

Property Value

string

The ID.

IsCustom

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

.

Declaration

cs-api-definition
public bool IsCustom { get; set; }

Property Value

bool

IsDefault

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

Declaration

cs-api-definition
public bool IsDefault { get; set; }

Property Value

bool

The is default.

IsPrimary

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

Declaration

cs-api-definition
public bool IsPrimary { get; set; }

Property Value

bool

LinkedStyleId

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.

Declaration

cs-api-definition
public string LinkedStyleId { get; set; }

Property Value

string

The linked style ID.

Name

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

Declaration

cs-api-definition
public string Name { get; set; }

Property Value

string

The name.

NextStyleId

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

Declaration

cs-api-definition
public string NextStyleId { get; set; }

Property Value

string

The next style id.

ParagraphProperties

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

Declaration

cs-api-definition
public ParagraphProperties ParagraphProperties { get; }

Property Value

ParagraphProperties

The paragraph properties.

StyleType

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

Declaration

cs-api-definition
public StyleType StyleType { get; }

Property Value

StyleType

The type of the style.

TableCellProperties

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

Declaration

cs-api-definition
public TableCellProperties TableCellProperties { get; }

Property Value

TableCellProperties

The table cell properties.

TableProperties

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

Declaration

cs-api-definition
public TableProperties TableProperties { get; }

Property Value

TableProperties

The table properties.

TableRowProperties

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

Declaration

cs-api-definition
public TableRowProperties TableRowProperties { get; }

Property Value

TableRowProperties

The table row properties.

UIPriority

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

Declaration

cs-api-definition
public int UIPriority { get; set; }

Property Value

int

The UI priority.

Methods

Clone()

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

Declaration

cs-api-definition
public Style Clone()

Returns

Style

The cloned style.

GetPropertyValue(IStylePropertyDefinition)

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

Declaration

cs-api-definition
public object GetPropertyValue(IStylePropertyDefinition stylePropertyDefinition)

Parameters

stylePropertyDefinition

IStylePropertyDefinition

The style property definition.

Returns

object