Class StyleRepository
Manages the collection of styles in a document, supporting registration, retrieval, and default style tracking.
Inheritance
Inherited Members
Namespace: Telerik.Windows.Documents.Flow.Model.Styles
Assembly: Telerik.Windows.Documents.Flow.dll
Syntax
public class StyleRepository
Properties
Document
Gets the document that owns this style repository.
Declaration
public RadFlowDocument Document { get; }
Property Value
|
RadFlowDocument
The document. |
Styles
Gets all styles currently registered in the repository.
Declaration
public IEnumerable<Style> Styles { get; }
Property Value
|
System.Collections.Generic.IEnumerable<Style>
The styles. |
Methods
Add(Style)
Registers the specified style in the repository and associates it with this document.
Declaration
public void Add(Style style)
Parameters
|
Style
style
The style. |
Exceptions
|
System.ArgumentNullException
|
AddBuiltInStyle(String)
Creates and registers a built-in style by its identifier; returns the newly added style. Use IDs from BuiltInStyleNames class.
Declaration
public Style AddBuiltInStyle(string styleId)
Parameters
|
System.String
styleId
The ID of the built-in style. |
Returns
|
Style
The built-in style, added to the repository. |
Exceptions
|
System.ArgumentException
|
Clear()
Unregisters all styles from the repository.
Declaration
public void Clear()
Contains(String)
Checks whether a style with the specified identifier exists in the repository.
Declaration
public bool Contains(string styleId)
Parameters
|
System.String
styleId
The style id. |
Returns
|
System.Boolean
true if |
GetDefaultStyle(StyleType)
Retrieves the default style for the specified style type, or null if none is registered.
Declaration
public Style GetDefaultStyle(StyleType type)
Parameters
|
StyleType
type
The type. |
Returns
|
Style
The default style or null if such is not present in the repository. |
GetStyle(String)
Retrieves the style with the specified identifier, or null if not found.
Declaration
public Style GetStyle(string styleId)
Parameters
|
System.String
styleId
The style id. |
Returns
|
Style
The style with the given id or null if such is not present in the repository. |
Remove(String)
Unregisters the style with the specified identifier from the repository.
Declaration
public void Remove(string styleId)
Parameters
|
System.String
styleId
The style id. |
Remove(Style)
Unregisters the specified style from the repository.
Declaration
public void Remove(Style style)
Parameters
|
Style
style
The style. |