Class
DocumentElement

An abstract class representing a document element.

Definition

Namespace:Telerik.Windows.Documents.Model

Assembly:Telerik.Windows.Controls.RichTextBox.dll

Syntax:

cs-api-definition
public abstract class DocumentElement

Inheritance: objectDocumentElement

Derived Classes: BlockInlineRadDocument

Constructors

DocumentElement()

Initializes a new instance of the DocumentElement class.

Declaration

cs-api-definition
protected DocumentElement()

Properties

ChildIndex

Gets the index of the element inside its parent structure.

Declaration

cs-api-definition
public int ChildIndex { get; }

Property Value

int

The index.

Children

Gets the children.

Declaration

cs-api-definition
public DocumentElementCollection Children { get; }

Property Value

DocumentElementCollection

The children.

Cursor

Gets or sets the cursor image used when the mouse pointer is over the document element.

Declaration

cs-api-definition
public virtual Cursor Cursor { get; set; }

Property Value

Cursor

The cursor.

DocumentElements

Gets the elements representing the children of this document element.

Declaration

cs-api-definition
protected DocumentElementCollection DocumentElements { get; }

Property Value

DocumentElementCollection

The document elements.

FirstLayoutBox

Represents the first LayoutBox responsible for showing the element.

Declaration

cs-api-definition
public LayoutBox FirstLayoutBox { get; }

Property Value

LayoutBox

The first layout box.

HasStyle

Gets a value indicating whether this instance has style.

Declaration

cs-api-definition
public bool HasStyle { get; }

Property Value

bool

true if this instance has style; otherwise, false.

IsFirstLayoutBoxInitialized

Gets a value indicating whether the FirstLayoutBox is initialized.

Declaration

cs-api-definition
protected bool IsFirstLayoutBoxInitialized { get; }

Property Value

bool

true if this instance is first layout box initialized; otherwise, false.

NextSibling

Gets the next sibling.

Declaration

cs-api-definition
public DocumentElement NextSibling { get; }

Property Value

DocumentElement

The next sibling.

Parent

Gets the parent.

Declaration

cs-api-definition
public DocumentElement Parent { get; }

Property Value

DocumentElement

The parent.

PreviousSibling

Gets the previous sibling.

Declaration

cs-api-definition
public DocumentElement PreviousSibling { get; }

Property Value

DocumentElement

The previous sibling.

Style

Gets or sets the style of the document element.

Declaration

cs-api-definition
public virtual StyleDefinition Style { get; set; }

Property Value

StyleDefinition

The style.

StyleName

Gets or sets the name of the style.

Declaration

cs-api-definition
[XamlSerializable("")]
public string StyleName { get; set; }

Property Value

string

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

cs-api-definition
[XamlSerializable("")]
public virtual string Tag { get; set; }

Property Value

string

Methods

ClearValue(IStylePropertyDefinition)

Clears the value of a style property.

Declaration

cs-api-definition
public void ClearValue(IStylePropertyDefinition propertyDefinition)

Parameters

propertyDefinition

IStylePropertyDefinition

The property definition.

CopyPropertiesFrom(DocumentElement)

Copies the properties from another document element.

Declaration

cs-api-definition
public void CopyPropertiesFrom(DocumentElement fromElement)

Parameters

fromElement

DocumentElement

The element to copy the properties from.

Exceptions

NullReferenceException

fromElement must not be null.

InvalidOperationException

Cannot copy properties to element itself.

CopyPropertiesFromOverride(DocumentElement)

Copies the properties from another document element to the current instance.

Declaration

cs-api-definition
protected abstract void CopyPropertiesFromOverride(DocumentElement fromElement)

Parameters

fromElement

DocumentElement

The DocumentElement to copy the properties from.

CopyPropertiesFromStyle(StyleDefinition)

Copies the properties from a specified style.

Declaration

cs-api-definition
public void CopyPropertiesFromStyle(StyleDefinition style)

Parameters

style

StyleDefinition

The style to copy the properties from.

CreateDeepCopy()

Creates a deep copy of the element.

Declaration

cs-api-definition
public virtual DocumentElement CreateDeepCopy()

Returns

DocumentElement

The copied element.

CreateLayoutBox()

Creates a LayoutBox for the document element.

Declaration

cs-api-definition
protected LayoutBox CreateLayoutBox()

Returns

LayoutBox

The created LayoutBox.

CreateLayoutBox(DocumentStructureCollection)

Creates a LayoutBox for the element.

Declaration

cs-api-definition
public abstract LayoutBox CreateLayoutBox(DocumentStructureCollection documentCollection)

Parameters

documentCollection

DocumentStructureCollection

The document collection.

Returns

LayoutBox

CreateNewElementInstance()

Creates a new instance of this element.

Declaration

cs-api-definition
protected abstract DocumentElement CreateNewElementInstance()

Returns

DocumentElement

The new instance.

CreateShallowCopy()

Creates a shallow copy of the element.

Declaration

cs-api-definition
public virtual DocumentElement CreateShallowCopy()

Returns

DocumentElement

The copied element.

EnumerateChildrenOfType<T>()

Iterates through the children of the document element.

Declaration

cs-api-definition
public IEnumerable<T> EnumerateChildrenOfType<T>() where T : DocumentElement

Returns

IEnumerable<T>

A collection of all the child elements of the specified type.

ExtractStyleFromLocalProperties()

Extracts a style from the local properties of the element.

Declaration

cs-api-definition
public StyleDefinition ExtractStyleFromLocalProperties()

Returns

StyleDefinition

A StyleDefinition instance created from the element's local properties.

ExtractStyleFromProperties()

Extracts a style from the style properties of the element.

Declaration

cs-api-definition
public StyleDefinition ExtractStyleFromProperties()

Returns

StyleDefinition

A StyleDefinition instance created from the element's style properties.

GetAssociatedLayoutBoxes()

Gets the LayoutBoxes associated to the element.

Declaration

cs-api-definition
public IEnumerable<LayoutBox> GetAssociatedLayoutBoxes()

Returns

IEnumerable<LayoutBox>

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

cs-api-definition
public T GetParentOfType<T>() where T : DocumentElement

Returns

T

The first parent of the specified type, or null if the element doesn't have parent.

GetPropertyValueSource(IStylePropertyDefinition)

Gets the source of the value of a specified property.

Declaration

cs-api-definition
public RadValueSource GetPropertyValueSource(IStylePropertyDefinition propertyDefinition)

Parameters

propertyDefinition

IStylePropertyDefinition

The property definition.

Returns

RadValueSource

A RadValueSource representing the source of the value.

GetRootDocument()

Gets the RadDocument instance associated to the element.

Declaration

cs-api-definition
public RadDocument GetRootDocument()

Returns

RadDocument

GetStyleProperty(IStylePropertyDefinition)

Gets a style property from a specified definition.

Declaration

cs-api-definition
public StylePropertyBase GetStyleProperty(IStylePropertyDefinition propertyDefinition)

Parameters

propertyDefinition

IStylePropertyDefinition

The property definition.

Returns

StylePropertyBase

The style property.

GetStyleProperty(string)

Gets a style property by name.

Declaration

cs-api-definition
public StylePropertyBase GetStyleProperty(string propertyName)

Parameters

propertyName

string

The name of the property.

Returns

StylePropertyBase

The style property.

InvalidateAssociatedBoxesArrange()

Invalidates the arrange of the layout boxes associated to this element.

Declaration

cs-api-definition
protected void InvalidateAssociatedBoxesArrange()

InvalidateAssociatedBoxesLayout()

Invalidates the layout of the layout boxes associated to this element.

Declaration

cs-api-definition
public void InvalidateAssociatedBoxesLayout()

InvalidateAssociatedBoxesMeasure()

Invalidates the measure of the layout boxes associated to this element.

Declaration

cs-api-definition
protected void InvalidateAssociatedBoxesMeasure()

OnParentChanged()

Called when the parent of the element has been changed.

Declaration

cs-api-definition
protected virtual void OnParentChanged()

OnParentChanging()

Called when the parent of the element is changing.

Declaration

cs-api-definition
protected virtual void OnParentChanging()

OnRemoved()

Called when a DocumentElement is removed.

Declaration

cs-api-definition
protected virtual void OnRemoved()

OnStyleChanged()

Called after the style of a document element has been changed.

Declaration

cs-api-definition
protected virtual void OnStyleChanged()

OnStyleChanging()

Called before the style of a document element changes.

Declaration

cs-api-definition
protected virtual void OnStyleChanging()

OnStylePropertyChanged(StylePropertyChangeEventArgs)

Declaration

cs-api-definition
protected virtual void OnStylePropertyChanged(StylePropertyChangeEventArgs args)

Parameters

args

StylePropertyChangeEventArgs

Events

ParentChanged

Occurs after changing the parent of the element.

Declaration

cs-api-definition
public event EventHandler ParentChanged

Event Value

EventHandler

ParentChanging

Occurs before changing the parent of the element.

Declaration

cs-api-definition
public event EventHandler ParentChanging

Event Value

EventHandler

PropertyValueChanged

Occurs after changing the value of a property.

Declaration

cs-api-definition
public event StylePropertyChangeEventHandler PropertyValueChanged

Event Value

StylePropertyChangeEventHandler

StyleChanged

Called after the style of a document element has been changed.

Declaration

cs-api-definition
public event EventHandler StyleChanged

Event Value

EventHandler

StyleChanging

Called before the style of a document element changes.

Declaration

cs-api-definition
public event EventHandler StyleChanging

Event Value

EventHandler

StylePropertyChanged

Called after the style of a document element has been changed.

Declaration

cs-api-definition
public event StylePropertyChangeEventHandler StylePropertyChanged

Event Value

StylePropertyChangeEventHandler