Class DocumentElement
An abstract class representing a document element.
Inheritance
Namespace: Telerik.Windows.Documents.Model
Assembly: Telerik.Windows.Controls.RichTextBox.dll
Syntax
public abstract class DocumentElement : Object
Constructors
DocumentElement()
Properties
ChildIndex
Gets the index of the element inside its parent structure.
Declaration
public int ChildIndex { get; }
Property Value
System. The index. |
Children
Gets the children.
Declaration
public DocumentElementCollection Children { get; }
Property Value
Document The children. |
Cursor
Gets or sets the cursor image used when the mouse pointer is over the document element.
Declaration
public virtual Cursor Cursor { get; set; }
Property Value
System. The cursor. |
DocumentElements
Gets the elements representing the children of this document element.
Declaration
protected DocumentElementCollection DocumentElements { get; }
Property Value
Document The document elements. |
FirstLayoutBox
Represents the first Layout
Declaration
public LayoutBox FirstLayoutBox { get; }
Property Value
Layout The first layout box. |
HasStyle
Gets a value indicating whether this instance has style.
Declaration
public bool HasStyle { get; }
Property Value
System.
|
IsFirstLayoutBoxInitialized
Gets a value indicating whether the First
Declaration
protected bool IsFirstLayoutBoxInitialized { get; }
Property Value
System.
|
LastLayoutBox
Represents the last Layout
Declaration
public LayoutBox LastLayoutBox { get; }
Property Value
Layout The last layout box. |
NextSibling
Gets the next sibling.
Declaration
public DocumentElement NextSibling { get; }
Property Value
Document The next sibling. |
OriginalProperties
Declaration
[XamlCompositePropertySerializable]
public DocumentElementPropertiesBase OriginalProperties { get; set; }
Property Value
Parent
Gets the parent.
Declaration
public DocumentElement Parent { get; }
Property Value
Document The parent. |
PreviousSibling
Gets the previous sibling.
Declaration
public DocumentElement PreviousSibling { get; }
Property Value
Document The previous sibling. |
RevisionInfo
Declaration
[XamlCompositePropertySerializable]
public RevisionInfo RevisionInfo { get; set; }
Property Value
Style
Gets or sets the style of the document element.
Declaration
public virtual StyleDefinition Style { get; set; }
Property Value
Style The style. |
StyleName
Gets or sets the name of the style.
Declaration
[XamlSerializable("")]
public string StyleName { get; set; }
Property Value
System. The name of the style. |
Tag
String property that allows developers to attach custom data to the DocumentElement. The value of this property will be copied to DocumentElements created out of this DocumentElement during editing.
Declaration
[XamlSerializable("")]
public virtual string Tag { get; set; }
Property Value
System.
|
Methods
add_PropertyValueChanged(StylePropertyChangeEventHandler)
Declaration
public void add_PropertyValueChanged(StylePropertyChangeEventHandler value)
Parameters
add_StylePropertyChanged(StylePropertyChangeEventHandler)
Declaration
public void add_StylePropertyChanged(StylePropertyChangeEventHandler value)
Parameters
ClearValue(IStylePropertyDefinition)
Clears the value of a style property.
Declaration
public void ClearValue(IStylePropertyDefinition propertyDefinition)
Parameters
IStyle The property definition. |
CopyPropertiesFrom(DocumentElement)
Copies the properties from another document element.
Declaration
public void CopyPropertiesFrom(DocumentElement fromElement)
Parameters
Document The element to copy the properties from. |
Exceptions
System. fromElement must not be null. |
System. Cannot copy properties to element itself. |
CopyPropertiesFromOverride(DocumentElement)
Copies the properties from another document element to the current instance.
Declaration
protected abstract void CopyPropertiesFromOverride(DocumentElement fromElement)
Parameters
Document The Document |
CopyPropertiesFromStyle(StyleDefinition)
Copies the properties from a specified style.
Declaration
public void CopyPropertiesFromStyle(StyleDefinition style)
Parameters
Style The style to copy the properties from. |
CreateDeepCopy()
Creates a deep copy of the element.
Declaration
public virtual DocumentElement CreateDeepCopy()
Returns
Document The copied element. |
CreateLayoutBox()
Creates a Layout
Declaration
protected LayoutBox CreateLayoutBox()
Returns
CreateLayoutBox(DocumentStructureCollection)
Creates a Layout
Declaration
public abstract LayoutBox CreateLayoutBox(DocumentStructureCollection documentCollection)
Parameters
Document The document collection. |
Returns
CreateNewElementInstance()
Creates a new instance of this element.
Declaration
protected abstract DocumentElement CreateNewElementInstance()
Returns
Document The new instance. |
CreateShallowCopy()
Creates a shallow copy of the element.
Declaration
public virtual DocumentElement CreateShallowCopy()
Returns
Document The copied element. |
EnumerateChildrenOfType<T>()
Iterates through the children of the document element.
Declaration
public IEnumerable<T> EnumerateChildrenOfType<T>()
where T : DocumentElement
Returns
System. A collection of all the child elements of the specified type. |
Type Parameters
T
The type of document elements you would like to obtain. |
ExtractStyleFromLocalProperties()
Extracts a style from the local properties of the element.
Declaration
public StyleDefinition ExtractStyleFromLocalProperties()
Returns
Style A Style |
ExtractStyleFromProperties()
Extracts a style from the style properties of the element.
Declaration
public StyleDefinition ExtractStyleFromProperties()
Returns
Style A Style |
GetAssociatedLayoutBoxes()
Gets the Layout
Declaration
public IEnumerable<LayoutBox> GetAssociatedLayoutBoxes()
Returns
System. Collection of the layout boxes associated to the element. |
GetParentOfType<T>()
Iterates through the parent elements of the document element and returns the first occurence of a parent of the specified type.
Declaration
public T GetParentOfType<T>()
where T : DocumentElement
Returns
T
The first parent of the specified type, or |
Type Parameters
T
The type of document element you would like to obtain. |
GetPropertyValueSource(IStylePropertyDefinition)
Gets the source of the value of a specified property.
Declaration
public RadValueSource GetPropertyValueSource(IStylePropertyDefinition propertyDefinition)
Parameters
IStyle The property definition. |
Returns
Rad A Rad |
GetRootDocument()
Gets the Rad
Declaration
public RadDocument GetRootDocument()
Returns
GetStyleProperty(String)
Gets a style property by name.
Declaration
public StylePropertyBase GetStyleProperty(string propertyName)
Parameters
System. The name of the property. |
Returns
Style The style property. |
GetStyleProperty(IStylePropertyDefinition)
Gets a style property from a specified definition.
Declaration
public StylePropertyBase GetStyleProperty(IStylePropertyDefinition propertyDefinition)
Parameters
IStyle The property definition. |
Returns
Style The style property. |
InvalidateAssociatedBoxesArrange()
Invalidates the arrange of the layout boxes associated to this element.
Declaration
protected void InvalidateAssociatedBoxesArrange()
InvalidateAssociatedBoxesLayout()
Invalidates the layout of the layout boxes associated to this element.
Declaration
public void InvalidateAssociatedBoxesLayout()
InvalidateAssociatedBoxesMeasure()
Invalidates the measure of the layout boxes associated to this element.
Declaration
protected void InvalidateAssociatedBoxesMeasure()
OnParentChanged()
Called when the parent of the element has been changed.
Declaration
protected virtual void OnParentChanged()
OnParentChanging()
Called when the parent of the element is changing.
Declaration
protected virtual void OnParentChanging()
OnRemoved()
Called when a DocumentElement is removed.
Declaration
protected virtual void OnRemoved()
OnStyleChanged()
Called after the style of a document element has been changed.
Declaration
protected virtual void OnStyleChanged()
OnStyleChanging()
Called before the style of a document element changes.
Declaration
protected virtual void OnStyleChanging()
OnStylePropertyChanged(StylePropertyChangeEventArgs)
Declaration
protected virtual void OnStylePropertyChanged(StylePropertyChangeEventArgs args)
Parameters
remove_PropertyValueChanged(StylePropertyChangeEventHandler)
Declaration
public void remove_PropertyValueChanged(StylePropertyChangeEventHandler value)
Parameters
remove_StylePropertyChanged(StylePropertyChangeEventHandler)
Declaration
public void remove_StylePropertyChanged(StylePropertyChangeEventHandler value)
Parameters
Events
ParentChanged
Occurs after changing the parent of the element.
Declaration
public event EventHandler ParentChanged
Event Type
System.
|
ParentChanging
Occurs before changing the parent of the element.
Declaration
public event EventHandler ParentChanging
Event Type
System.
|
PropertyValueChanged
Occurs after changing the value of a property.
Declaration
public event StylePropertyChangeEventHandler PropertyValueChanged
Event Type
StyleChanged
Called after the style of a document element has been changed.
Declaration
public event EventHandler StyleChanged
Event Type
System.
|
StyleChanging
Called before the style of a document element changes.
Declaration
public event EventHandler StyleChanging
Event Type
System.
|
StylePropertyChanged
Called after the style of a document element has been changed.
Declaration
public event StylePropertyChangeEventHandler StylePropertyChanged