ClassStyleRepository
Manages the collection of styles in a document, supporting registration, retrieval, and default style tracking.
Definition
Namespace:Telerik.Windows.Documents.Flow.Model.Styles
Assembly:Telerik.Windows.Documents.Flow.dll
Syntax:
public class StyleRepository
Inheritance: objectStyleRepository
Properties
Document
Gets the document that owns this style repository.
Declaration
public RadFlowDocument Document { get; }
Property Value
The document.
Methods
Add(Style)
Registers the specified style in the repository and associates it with this document.
Declaration
public void Add(Style style)
Parameters
style
The style.
Exceptions
style is part of another style repository.
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
styleId
The ID of the built-in style.
Returns
The built-in style, added to the repository.
Exceptions
styleId is not an ID of a built-in style.
Contains(string)
Checks whether a style with the specified identifier exists in the repository.
Declaration
public bool Contains(string styleId)
Parameters
styleId
The style id.
Returns
true if styleId is found in the StyleRepository; otherwise, false.
GetDefaultStyle(StyleType)
Retrieves the default style for the specified style type, or null if none is registered.
GetStyle(string)
Retrieves the style with the specified identifier, or null if not found.
Remove(Style)
Unregisters the specified style from the repository.
Remove(string)
Unregisters the style with the specified identifier from the repository.
Declaration
public void Remove(string styleId)
Parameters
styleId
The style id.