콘텐츠로 이동

Element class

이 콘텐츠는 아직 번역되지 않았습니다.

Base class for all UI elements, providing the measure and arrange layout passes.

Guide: C# Markup reference: Element

public abstract class Element : MewObject
name description
Bounds { get; } Gets the bounds from the arrange pass in window coordinates, not the parent’s, left untransformed under an element that transforms its children.
Commands { get; } Gets this element’s command handler scope, creating it on first access.
DesiredSize { get; } Gets the desired size calculated during the Measure pass.
InputMap { get; } Gets this element’s local input map, creating it on first access.
IsArrangeDirty { get; } Gets whether a new Arrange pass is needed.
IsMeasureDirty { get; } Gets whether a new Measure pass is needed.
LogicalParent { get; } Gets the logical owner of this element. Independent from the visual Parent; a logical child may exist without being attached to any visual tree.
Parent { get; } Gets the visual parent element, or null when detached.
RenderSize { get; } Gets the size from the arrange pass, equivalent to WPF’s RenderSize.
Arrange(…) Positions and sizes the element within the given bounds, measuring it first when its measure is out of date.
FindLogicalRoot() Returns the topmost element of the logical parent chain, this element itself when it has no logical owner.
FindVisualRoot() Gets the Window at the root of this element’s visual tree, or null when the tree is not rooted in a window.
virtual InvalidateArrange() Invalidates the Arrange pass, causing a re-arrange on next layout.
virtual InvalidateMeasure() Invalidates the Measure pass, causing a re-measure on next layout.
virtual InvalidateVisual() Invalidates the element’s visuals so the next frame repaints them.
IsAncestorOf(…) Determines whether this element is an ancestor of the specified element.
IsDescendantOf(…) Determines whether this element is a descendant of the specified element.
Measure(…) Measures the element and determines its desired size; a clean element measured again with the same constraint is skipped.
virtual Render(…) Renders the element to the graphics context; subclasses override IGraphicsContext) instead.
TransformToAncestor(…) Returns a transform from this element’s coordinate space to the specified ancestor’s coordinate space, including any transform an element between them applies to its children.
TransformToDescendant(…) Returns a transform from this element’s coordinate space to the specified descendant’s coordinate space.
TransformToVisual(…) Returns a transform from this element’s coordinate space to the specified visual’s coordinate space, including any transform an element between them applies to its children. Both elements must be in the same visual tree.
TranslatePoint(…) Converts a point in this element’s coordinate space to the specified element’s coordinate space.
TranslateRect(…) Converts a rectangle in this element’s coordinate space to the specified element’s coordinate space.