Class StyleDefinition
Inheritance
Namespace: Telerik.Windows.Documents.Model.Styles
Assembly: Telerik.Windows.Controls.RichTextBox.dll
Syntax
public class StyleDefinition : Object, INotifyStylePropertyChange, IElementWithStyle, INotifyPropertyChanged
Constructors
StyleDefinition()
Declaration
public StyleDefinition()
StyleDefinition(String, DocumentElement)
Creates a new instance of StyleDefinition of StyleType corresponding to specific DocumentElement, with specified Name
Declaration
public StyleDefinition(string name, DocumentElement element)
Parameters
System. Unique Name of the style, that would be used to identify style in StyleRepository collection |
Document DocumentElement that would be used to determine the StyleType |
StyleDefinition(String, StyleType)
Creates a new instance of StyleDefinition of corresponding StyleType and Name (style id).
Declaration
public StyleDefinition(string name, StyleType styleType)
Parameters
System. Unique Name of the style, that would be used to identify style in StyleRepository collection |
Style StyleType corresponding to the type of document elements this style should apply to |
StyleDefinition(DocumentElement)
Creates a new instance of StyleDefinition of StyleType corresponding to specific DocumentElement
Declaration
public StyleDefinition(DocumentElement element)
Parameters
Document DocumentElement that would be used to determine the StyleType |
StyleDefinition(StyleDefinition)
Creates a new instance of StyleDefinition and copies all relevant property values from the specified StyleDefinition instance.
Declaration
public StyleDefinition(StyleDefinition styleDefinition)
Parameters
Style The instance to copy the properties from. |
StyleDefinition(StyleType)
Creates a new instance of StyleDefinition of corresponding StyleType
Declaration
public StyleDefinition(StyleType styleType)
Parameters
Style StyleType corresponding to the type of document elements this style should apply to |
Properties
BasedOn
Gets or sets the base StyleDefinition
Declaration
public StyleDefinition BasedOn { get; set; }
Property Value
Remarks
StyleDefinition inherits its property values from BasedOn style. Either BasedOn or BasedOnName can be specified. If BasedOnName is specified BasedOn StyleDefinition would be set automatically if this style definition is added to a document StyleRepository that contains StyleDefinition with corresponding Name.
BasedOnName
Gets or sets the name of base style
Declaration
[XamlSerializable("")]
public string BasedOnName { get; set; }
Property Value
System.
|
Remarks
StyleDefinition inherits its property values from BasedOn style. Either BasedOn or BasedOnName can be specified. If BasedOnName is specified BasedOn StyleDefinition would be set automatically if this style definition is added to a document StyleRepository that contains StyleDefinition with corresponding Name.
ConditionalTableStylesCollection
Declaration
public ConditionalTableStylesCollection ConditionalTableStylesCollection { get; }
Property Value
ConditionalTableStylesList
Property used for serialization only. Use ConditionalTableStylesCollection instead.
Declaration
[XamlCompositePropertySerializable]
public List<ConditionalTableStyleInfo> ConditionalTableStylesList { get; set; }
Property Value
System.
|
Description
Declaration
public string Description { get; }
Property Value
System.
|
DisplayName
Gets or sets value corresponding to the name of the style, that would be displayed in Styles dialog, style gallery and other parts of the UI
Declaration
[XamlSerializable("")]
public string DisplayName { get; set; }
Property Value
System.
|
Document
Gets RadDocument that owns this StyleDefinition instance.
Declaration
public RadDocument Document { get; }
Property Value
IsCustom
Gets or sets value indicating whether the style is custom user-created
Declaration
[XamlSerializable]
public bool IsCustom { get; set; }
Property Value
System.
|
IsDefault
Gets or sets value indicating whether the style will be applied by default to the document elements of type corresponding to style's Type.
Declaration
[XamlSerializable]
public bool IsDefault { get; set; }
Property Value
System.
|
IsPrimary
Gets or sets value indicating whether the style will be visible in the styles gallery.
Declaration
[XamlSerializable]
public bool IsPrimary { get; set; }
Property Value
System.
|
LinkedStyle
Gets or sets linked StyleDefinition. Only Paragraph and Character types of styles can be linked
Declaration
public StyleDefinition LinkedStyle { get; set; }
Property Value
Remarks
This property can be set to Paragraph or Character style only. Paragraph style can be linked only to Character style and vice versa. StyleDefinition would obtain the corresponding property values from the linked style. Either LenkedStyle or LinkedStyleName can be specified. If BasedOnName is specified BasedOn StyleDefinition would be set automatically if this style definition is added to a document StyleRepository that contains StyleDefinition with corresponding Name.
LinkedStyleName
Gets or sets the name of the linked style.
Declaration
[XamlSerializable("")]
public string LinkedStyleName { get; set; }
Property Value
System.
|
Remarks
This property can be set to Paragraph or Character style only. Paragraph style can be linked only to Character style and vice versa. StyleDefinition would obtain the corresponding property values from the linked style. Either LinkedStyle or LinkedStyleName can be specified. If BasedOnName is specified BasedOn StyleDefinition would be set automatically if this style definition is added to a document StyleRepository that contains StyleDefinition with corresponding Name.
Name
Gets or sets value corresponding to the unique name of the style, that would be used to identify style in StyleRepository collection in the document
Declaration
[XamlSerializable]
public string Name { get; set; }
Property Value
System.
|
NextStyleName
Gets or sets the style which shall automatically be applied to a new paragraph created following a paragraph with this style.
Declaration
[XamlSerializable("")]
public string NextStyleName { get; set; }
Property Value
System. The name of the next style. |
Remarks
This property will have effect when set to Paragraph style only.
ParagraphProperties
Gets properties related to Paragraphs in the document
Declaration
public ParagraphProperties ParagraphProperties { get; set; }
Property Value
ParagraphStyle
Declaration
[XamlCompositePropertySerializable]
public ParagraphProperties ParagraphStyle { get; set; }
Property Value
SpanProperties
Gets properties related to Spans in the document
Declaration
public SpanProperties SpanProperties { get; set; }
Property Value
SpanStyle
Declaration
[XamlCompositePropertySerializable]
public SpanProperties SpanStyle { get; set; }
Property Value
TableCellProperties
Gets properties related to Table-cells in the document
Declaration
public TableCellProperties TableCellProperties { get; set; }
Property Value
TableCellStyle
Declaration
[XamlCompositePropertySerializable]
public TableCellProperties TableCellStyle { get; set; }
Property Value
TableProperties
Gets properties related to Tables in the document
Declaration
public TableProperties TableProperties { get; set; }
Property Value
TableRowProperties
Gets properties related to Table-rows in the document
Declaration
public TableRowProperties TableRowProperties { get; set; }
Property Value
TableRowStyle
Declaration
[XamlCompositePropertySerializable]
public TableRowProperties TableRowStyle { get; set; }
Property Value
TableStyle
Declaration
[XamlCompositePropertySerializable]
public TableProperties TableStyle { get; set; }
Property Value
Type
Gets or sets StyleType corresponding to the type of document elements this style should be applied to.
Declaration
[XamlSerializable]
public StyleType Type { get; set; }
Property Value
UIPriority
Gets or sets the UI priority of the style. Negative values will be transformed to zero (0);
Declaration
[XamlSerializable(10000)]
public int UIPriority { get; set; }
Property Value
System. The UI priority. |
Methods
add_StylePropertyChanged(StylePropertyChangeEventHandler)
Declaration
public void add_StylePropertyChanged(StylePropertyChangeEventHandler value)
Parameters
Implements
add_StylePropertyChanging(StylePropertyChangeEventHandler)
Declaration
public void add_StylePropertyChanging(StylePropertyChangeEventHandler value)
Parameters
Implements
Clear()
Declaration
public void Clear()
ClearPropertyValue(IStylePropertyDefinition)
Declaration
public void ClearPropertyValue(IStylePropertyDefinition property)
Parameters
IStyle
|
CopyPropertiesFrom(StyleDefinition)
Declaration
public void CopyPropertiesFrom(StyleDefinition fromStyleDefinition)
Parameters
Style
|
GetProperty(IStylePropertyDefinition)
Metod provided for backward compatibility. Please use the provided properties instead.
Declaration
public StylePropertyBase GetProperty(IStylePropertyDefinition propertyDefinition)
Parameters
IStyle
|
Returns
GetPropertyValue(IStylePropertyDefinition, DocumentElement)
Metod provided for backward compatibility. Please use the provided properties instead.
Declaration
public object GetPropertyValue(IStylePropertyDefinition propertyDefinition, DocumentElement initialValueEvaluationCaller = null)
Parameters
IStyle
|
Document
|
Returns
System.
|
GetStyleTypeForElement(IElementWithStyle)
Declaration
public static Nullable<StyleType> GetStyleTypeForElement(IElementWithStyle element)
Parameters
IElement
|
Returns
System.
|
IsPropertySet(IStylePropertyDefinition)
Declaration
public bool IsPropertySet(IStylePropertyDefinition propertyDefinition)
Parameters
IStyle
|
Returns
System.
|
MergePropertiesWith(StyleDefinition)
Declaration
public void MergePropertiesWith(StyleDefinition definitionToMergeWith)
Parameters
Style
|
OnDisplayNameChanged(NameChangingEventArgs)
Declaration
protected virtual void OnDisplayNameChanged(NameChangingEventArgs args)
Parameters
OnIsPrimaryChanged()
Declaration
protected virtual void OnIsPrimaryChanged()
OnNameChanged(NameChangingEventArgs)
Declaration
protected virtual void OnNameChanged(NameChangingEventArgs args)
Parameters
OnStylePropertyChanged(IStylePropertyDefinition, Object, Object)
Declaration
protected virtual void OnStylePropertyChanged(IStylePropertyDefinition propertyDefinition, object oldValue, object newValue)
Parameters
IStyle
|
System.
|
System.
|
OnStylePropertyChanging(IStylePropertyDefinition, Object, Object)
Declaration
protected virtual void OnStylePropertyChanging(IStylePropertyDefinition propertyDefinition, object oldValue, object newValue)
Parameters
IStyle
|
System.
|
System.
|
remove_StylePropertyChanged(StylePropertyChangeEventHandler)
Declaration
public void remove_StylePropertyChanged(StylePropertyChangeEventHandler value)
Parameters
Implements
remove_StylePropertyChanging(StylePropertyChangeEventHandler)
Declaration
public void remove_StylePropertyChanging(StylePropertyChangeEventHandler value)
Parameters
Implements
SetPropertyValue(IStylePropertyDefinition, Object)
Metod provided for backward compatibility. Please use the provided properties instead.
Declaration
public void SetPropertyValue(IStylePropertyDefinition propertyDefinition, object newValue)
Parameters
IStyle
|
System.
|
ToString()
Gets the string representation of this StyleDefinition that can be used to display information about property values.
Declaration
public override string ToString()
Returns
System.
|
Events
DisplayNameChanged
Declaration
public event EventHandler<NameChangingEventArgs> DisplayNameChanged
Event Type
System.
|
IsPrimaryChanged
Declaration
public event EventHandler IsPrimaryChanged
Event Type
System.
|
NameChanged
Declaration
public event EventHandler<NameChangingEventArgs> NameChanged
Event Type
System.
|
PropertyChanged
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
System.
|
StylePropertyChanged
Declaration
public event StylePropertyChangeEventHandler StylePropertyChanged
Event Type
Implements
StylePropertyChanging
Declaration
public event StylePropertyChangeEventHandler StylePropertyChanging
Event Type
Implements
Explicit Interface Implementations
IElementWithStyle.OnStyleRemovedFromDocument()
Declaration
void IElementWithStyle.OnStyleRemovedFromDocument()
Implements
IElementWithStyle.Style
Declaration
StyleDefinition IElementWithStyle.Style { get; set; }
Returns
Implements
IElementWithStyle.StyleName
Declaration
string IElementWithStyle.StyleName { get; set; }
Returns
System.
|
Implements
IElementWithStyle.StyleNameChanged()
Declaration
void IElementWithStyle.StyleNameChanged()
Implements
IElementWithStyle.StylePropertyChanged(Object, StylePropertyChangeEventArgs)
Declaration
void IElementWithStyle.StylePropertyChanged(object sender, StylePropertyChangeEventArgs args)
Parameters
System.
|
Style
|
Implements
IElementWithStyle.StylePropertyChanging(Object, StylePropertyChangeEventArgs)
Declaration
void IElementWithStyle.StylePropertyChanging(object sender, StylePropertyChangeEventArgs args)
Parameters
System.
|
Style
|