New to Telerik UI for WinForms? Start a free 30-day trial

Base class for elements measured and arranged by the document layout system.

Definition

Namespace:Telerik.WinForms.Documents.Layout

Assembly:Telerik.WinControls.RichTextEditor.dll

Syntax:

C#
public abstract class LayoutElement : RadObject, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor

Inheritance: objectDisposableObjectRadObjectLayoutElement

Derived Classes: LayoutBox

Implements: ICustomTypeDescriptorIDisposableINotifyPropertyChanged

Inherited Members RadObject.BindingContextPropertyRadObject.RadTypeRadObject.ReplaceDefaultDescriptors(PropertyDescriptorCollection)RadObject.DisposeManagedResources()RadObject.ClearPropertyStore()RadObject.SuspendPropertyNotifications()RadObject.ResumePropertyNotifications()RadObject.GetPropertyValue(RadProperty)RadObject.SetDefaultValueOverride(RadProperty, object)RadObject.GetValue(RadProperty)RadObject.SetValue(RadProperty, object)RadObject.ResetValue(RadProperty)RadObject.ResetLocalValue(RadProperty)RadObject.ResetValue(RadProperty, ValueResetFlags)RadObject.UpdateValue(RadProperty)RadObject.GetValueSource(RadProperty)RadObject.GetRegisteredRadProperty(string)RadObject.UpdateValueCore(RadPropertyValue)RadObject.SetValueCore(RadPropertyValue, object, object, ValueSource)RadObject.ResetValueCore(RadPropertyValue, ValueResetFlags)RadObject.GetDefaultValue(RadPropertyValue, object)RadObject.CoerceValue(RadPropertyValue, object)RadObject.ShouldSerializeProperty(RadProperty)RadObject.CanRaisePropertyChangeNotifications(RadPropertyValue)RadObject.BindProperty(RadProperty, RadObject, RadProperty, PropertyBindingOptions)RadObject.UnbindProperty(RadProperty)RadObject.AddStylePropertySetting(IPropertySetting)RadObject.GetInheritedValue(RadProperty)RadObject.OnPropertyChanging(RadPropertyChangingEventArgs)RadObject.OnPropertyChanged(RadPropertyChangedEventArgs)RadObject.OnNotifyPropertyChanged(string)RadObject.OnNotifyPropertyChanged(PropertyChangedEventArgs)RadObject.OnShouldSerializeProperty(ShouldSerializePropertyEventArgs)RadObject.IsPropertyCancelable(RadPropertyMetadata)RadObject.PropertyValuesRadObject.PropertyFilterRadObject.RadObjectTypeRadObject.BindingContextRadObject.PropertyChangedRadObject.RadPropertyChangedRadObject.RadPropertyChangingDisposableObject.GetBitState(long)DisposableObject.SetBitState(long, bool)DisposableObject.OnBitStateChanged(long, bool, bool)DisposableObject.Dispose()DisposableObject.Dispose(bool)DisposableObject.PerformDispose(bool)DisposableObject.DisposeUnmanagedResources()DisposableObject.EventsDisposableObject.IsDisposingDisposableObject.IsDisposedDisposableObject.DisposedDisposableObject.Disposing...

Constructors

Initializes the element in the specified document structure collection.

C#
public LayoutElement(DocumentStructureCollection collection)
Parameters:collectionDocumentStructureCollection

The collection that owns the element, or null to create a collection rooted at this element.

Properties

Gets or sets how the base arrangement policy aligns the arranged size within the available final rectangle.

C#
public ContentAlignment Alignment { get; set; }

Gets or sets a value indicating whether the element size will be calculated automatically by the layout system. Value of false indicates that the element's size will not be changed when calculating the layout.

C#
public virtual bool AutoSize { get; }

Gets the bit-vector storage for this element's layout state flags.

C#
protected DocumentElementStateBitVector BitState { get; }

Gets or sets whether measurement and arrangement bypass the base layout policies and use the override results directly.

C#
public bool BypassLayoutPolicies { get; set; }

Gets this element's child collection, creating it on first access.

C#
public ILinkedListCollection<LayoutElement> Children { get; }

Gets the control bounding rectangle clipped by ancestors that clip their children.

C#
public virtual RectangleF ClippedControlBoundingRectangle { get; }

Gets the axis-aligned bounding rectangle of this element after applying its complete layout transform.

C#
public virtual RectangleF ControlBoundingRectangle { get; }

Gets or sets the size calculated by the most recent measurement, or explicitly supplied by the layout owner.

C#
public SizeF DesiredSize { get; set; }

Gets whether the most recent arrangement is still valid.

C#
public bool IsArrangeValid { get; }

Gets whether this element is currently executing its measure pass.

C#
public bool IsMeasureInProgress { get; }

Gets whether the most recent measurement is still valid.

C#
public bool IsMeasureValid { get; }

Gets whether this element is a top-level container whose layout policy can govern vertical growth.

C#
public virtual bool IsTopContainer { get; }

Gets the element's offset from its parent's origin after arrangement.

C#
public PointF LayoutOffset { get; }

Gets the element's untransformed bounds in its parent's coordinate space.

C#
public RectangleF LocalBoundingRectangle { get; }

Gets or sets the measure-without-parent-notification state flag. The base layout implementation stores this flag but does not otherwise act on it.

C#
public bool MeasureWithoutParentNotification { get; set; }

Gets the parent element in the layout tree, or null for the root.

C#
public LayoutElement Parent { get; }

Gets the rectangle supplied to the most recent arrangement pass.

C#
public RectangleF PreviousArrangeRect { get; }

Gets or sets the size of the element which is the height and width of the visual rectangle that would contain the element. Size corresponds to element's Bounds.Size. When the AutoSize property is set to true setting the Size property to some value has no effect.

C#
public SizeF Size { get; set; }

Gets the transform formed by composing this element's transform with its ancestors' transforms.

C#
public RadMatrix TotalTransform { get; }

Gets the element's transform, including its arranged offset as translation.

C#
public RadMatrix Transform { get; }

Gets the level of this element in the LayoutElement tree it currently resides.

C#
public byte TreeLevel { get; protected set; }

Methods

Arranges the element within the supplied rectangle, measuring first if its measure data is invalid.

C#
public void Arrange(RectangleF finalRect)
Parameters:finalRectRectangleF

The element's available final rectangle in its parent's coordinate space.

Exceptions: InvalidOperationException

The rectangle has a NaN or positive-infinite width or height.

Applies the base layout policy and delegates element-specific positioning to ArrangeOverride(SizeF).

C#
protected virtual void ArrangeCore(RectangleF finalRect)
Parameters:finalRectRectangleF

The rectangle assigned to this element by its parent.

Arranges the LayoutElement to its final location. The element must call the Arrange method of each of its children.

C#
protected virtual SizeF ArrangeOverride(SizeF finalSize)
Parameters:finalSizeSizeF

The size that is available for element.

Returns:

SizeF

The rectangle occupied by the element. Usually finalSize. Should you return different size, the Layout system will restart measuring and rearranging the items. That could lead to infinite recursion.

In this method call to the Arrange method of each child must be made.

Creates the child collection for this element.

C#
protected virtual ILinkedListCollection<LayoutElement> CreateChildren()
Returns:

ILinkedListCollection<LayoutElement>

Creates the collection used to store this element's children.

C#
protected virtual ILinkedListCollection<LayoutElement> CreateChildrenCollection(DocumentStructureCollection collection)
Parameters:collectionDocumentStructureCollection

The document structure collection that owns the element.

Returns:

ILinkedListCollection<LayoutElement>

A collection backed by the document structure tree.

Creates the child collection the first time it is needed.

C#
protected void EnsureChildrenCreated()

Marks this element's arrangement as invalid and invokes the invalidation hook.

C#
public void InvalidateArrange()

Marks this element's arrangement as invalid and optionally invalidates all descendants.

C#
public void InvalidateArrange(bool recursive)
Parameters:recursivebool

true to invalidate child elements recursively.

Marks this element's measure data as invalid and invokes the invalidation hook.

C#
public virtual void InvalidateMeasure()

Marks this element's measurement as invalid and optionally invalidates all descendants.

C#
public void InvalidateMeasure(bool recursive)
Parameters:recursivebool

true to invalidate child elements recursively.

Determines whether the element is in a state that permits layout work. This implementation always returns true and ignores checkElementTree.

C#
protected bool IsInValidState(bool checkElementTree)
Parameters:checkElementTreebool

A flag that is not used by this implementation.

Returns:

bool

true in the base implementation.

Measures the element for the available size and updates DesiredSize. Reuses the previous result when the constraint is unchanged and measurement remains valid.

C#
public void Measure(SizeF availableSize)
Parameters:availableSizeSizeF

The available size; either dimension may be positive infinity.

Exceptions: InvalidOperationException

The available size contains NaN, or the measure override returns NaN or positive infinity.

Applies the base measurement policies and delegates element-specific measurement to MeasureOverride(SizeF).

C#
protected virtual SizeF MeasureCore(SizeF availableSize)
Parameters:availableSizeSizeF

The available size for measurement.

Returns:

SizeF

The desired size after applying the element's layout policies.

Measures the space required by the LayoutElement Used by the layout system.

C#
protected virtual SizeF MeasureOverride(SizeF availableSize)
Parameters:availableSizeSizeF

The size that is available to the LayoutElement. The available size can be infinity (to take the full size of the element)

Returns:

SizeF

The minimum size required by the element to be completely visible. Cannot be infinity.

In this method call to the Measure method of each child must be made.

Notifies the object for a change in its bit state.

C#
protected virtual void OnBitStateChanged(DocumentElementStates key, bool oldValue, bool newValue)
Parameters:keyDocumentElementStates

The DocumentElementStates key.

oldValuebool

The old value.

newValuebool

The new value.

Responds when a child's desired size changes. The base implementation invalidates this element's measure when its measure is valid, it is auto-sized, and it is not a clone.

C#
protected virtual void OnChildDesiredSizeChanged(LayoutElement child)
Parameters:childLayoutElement

The child whose desired size changed.

Provides a notification hook after this element's arrangement is invalidated.

C#
protected virtual void OnInvalidateArrange()

Provides a notification hook after this element's measurement is invalidated.

C#
protected virtual void OnInvalidateMeasure()

Raises ParentChanged after the parent reference changes.

C#
protected virtual void OnParentChanged()

Raises ParentChanging before the parent reference changes.

C#
protected virtual void OnParentChanging()

Applies the specified boolean value to the BitVector of the object.

C#
protected virtual void SetBitState(DocumentElementStates key, bool value)
Parameters:keyDocumentElementStates

The DocumentElementStates key.

valuebool

The value.

Updates the parent layout element and raises the parent-change notifications.

C#
protected virtual void SetParent(LayoutElement oldParent, LayoutElement newParent)
Parameters:oldParentLayoutElement

The current parent before the change.

newParentLayoutElement

The parent to assign, or null to detach this element.

Changes the parent reference, raising ParentChanging before assignment and ParentChanged afterward.

C#
protected void SetParentCore(LayoutElement newParent)
Parameters:newParentLayoutElement

The parent to assign, or null to detach this element.

Validates whether the specified element can be assigned as this element's parent. This check is called by the parent-assignment path in debug builds.

C#
protected virtual void ValidateParent(LayoutElement newParent)
Parameters:newParentLayoutElement

The proposed parent, or null when detaching this element.

Exceptions: InvalidOperationException

The parent type is not supported for this layout element.

Events

Occurs immediately after this element's parent reference changes.

C#
public event EventHandler ParentChanged

Occurs immediately before this element's parent reference changes.

C#
public event EventHandler ParentChanging