Layoutable Class

Summary

Implements layout-related functionality for a control.
graph TD Base0["Visual"]-->Type click Base0 "/api/Avalonia/Visual" Base1["StyledElement"]-->Base0 click Base1 "/api/Avalonia/StyledElement" Base2["Animatable"]-->Base1 click Base2 "/api/Avalonia.Animation/Animatable" Base3["AvaloniaObject"]-->Base2 click Base3 "/api/Avalonia/AvaloniaObject" Base4["object"]-->Base3 Interface0["IAvaloniaObjectDebug"]-.->Type click Interface0 "/api/Avalonia.Diagnostics/IAvaloniaObjectDebug" Interface1["INotifyPropertyChanged"]-.->Type Interface2["IStyledElement"]-.->Type click Interface2 "/api/Avalonia/IStyledElement" Interface3["IStyleable"]-.->Type click Interface3 "/api/Avalonia.Styling/IStyleable" Interface4["IAvaloniaObject"]-.->Type click Interface4 "/api/Avalonia/IAvaloniaObject" Interface5["INamed"]-.->Type click Interface5 "/api/Avalonia/INamed" Interface6["IStyleHost"]-.->Type click Interface6 "/api/Avalonia.Styling/IStyleHost" Interface7["ILogical"]-.->Type click Interface7 "/api/Avalonia.LogicalTree/ILogical" Interface8["IResourceNode"]-.->Type click Interface8 "/api/Avalonia.Controls/IResourceNode" Interface9["IResourceProvider"]-.->Type click Interface9 "/api/Avalonia.Controls/IResourceProvider" Interface10["ISetLogicalParent"]-.->Type click Interface10 "/api/Avalonia.Controls/ISetLogicalParent" Interface11["ISetInheritanceParent"]-.->Type click Interface11 "/api/Avalonia.Controls/ISetInheritanceParent" Interface12["ILayoutable"]-.->Type click Interface12 "/api/Avalonia.Layout/ILayoutable" Interface13["IVisual"]-.->Type click Interface13 "/api/Avalonia.VisualTree/IVisual" Type["Layoutable"] class Type type-node Type-->Derived0["Interactive"] click Derived0 "/api/Avalonia.Interactivity/Interactive"

Syntax

public class Layoutable : Visual, IAvaloniaObjectDebug, INotifyPropertyChanged, IStyledElement, 
    IStyleable, IAvaloniaObject, INamed, IStyleHost, ILogical, IResourceNode, IResourceProvider, 
    ISetLogicalParent, ISetInheritanceParent, ILayoutable, IVisual

Events

Name Type Summary
AttachedToLogicalTree EventHandler<LogicalTreeAttachmentEventArgs>
Raised when the styled element is attached to a rooted logical tree.
Inherited from StyledElement
AttachedToVisualTree EventHandler<VisualTreeAttachmentEventArgs>
Raised when the control is attached to a rooted visual tree.
Inherited from Visual
DataContextChanged EventHandler
Occurs when the DataContext property changes.
Inherited from StyledElement
DetachedFromLogicalTree EventHandler<LogicalTreeAttachmentEventArgs>
Raised when the styled element is detached from a rooted logical tree.
Inherited from StyledElement
DetachedFromVisualTree EventHandler<VisualTreeAttachmentEventArgs>
Raised when the control is detached from a rooted visual tree.
Inherited from Visual
Initialized EventHandler
Occurs when the styled element has finished initialization.
Inherited from StyledElement
LayoutUpdated EventHandler
Occurs when a layout pass completes for the control.
PropertyChanged EventHandler<AvaloniaPropertyChangedEventArgs>
Raised when a AvaloniaProperty value changes on this object.
Inherited from AvaloniaObject
ResourcesChanged EventHandler<ResourcesChangedEventArgs>
Occurs when a resource in this styled element or a parent styled element has changed.
Inherited from StyledElement

Fields

Name Constant Value Summary
BoundsProperty
Defines the Bounds property.
Inherited from Visual
static
ClipProperty
Defines the Clip property.
Inherited from Visual
static
ClipToBoundsProperty
Defines the ClipToBounds property.
Inherited from Visual
static
ClockProperty
Inherited from Animatable
static
DataContextProperty
Defines the DataContext property.
Inherited from StyledElement
static
DesiredSizeProperty
Defines the DesiredSize property.
static
HeightProperty
Defines the Height property.
static
HorizontalAlignmentProperty
Defines the HorizontalAlignment property.
static
IsVisibleProperty
Defines the IsVisibleProperty property.
Inherited from Visual
static
MarginProperty
Defines the Margin property.
static
MaxHeightProperty
Defines the MaxHeight property.
static
MaxWidthProperty
Defines the MaxWidth property.
static
MinHeightProperty
Defines the MinHeight property.
static
MinWidthProperty
Defines the MinWidth property.
static
NameProperty
Defines the Name property.
Inherited from StyledElement
static
OpacityMaskProperty
Defines the OpacityMask property.
Inherited from Visual
static
OpacityProperty
Defines the Opacity property.
Inherited from Visual
static
ParentProperty
Defines the Parent property.
Inherited from StyledElement
static
RenderTransformOriginProperty
Defines the RenderTransformOrigin property.
Inherited from Visual
static
RenderTransformProperty
Defines the RenderTransform property.
Inherited from Visual
static
TemplatedParentProperty
Defines the TemplatedParent property.
Inherited from StyledElement
static
TransformedBoundsProperty
Inherited from Visual
static
TransitionsProperty
Defines the Transitions property.
Inherited from Animatable
static
UseLayoutRoundingProperty
Defines the UseLayoutRoundingProperty property.
static
VerticalAlignmentProperty
Defines the VerticalAlignment property.
static
VisualParentProperty
Defines the VisualParent property.
Inherited from Visual
static
WidthProperty
Defines the Width property.
static
ZIndexProperty
Defines the ZIndex property.
Inherited from Visual
static

Properties

Name Value Summary
Bounds Rect
Gets the bounds of the control relative to its parent.
Inherited from Visual
Classes Classes
Gets or sets the styled element's classes.
Inherited from StyledElement
Clip Geometry
Gets or sets the geometry clip for this visual.
Inherited from Visual
ClipToBounds bool
Gets a value indicating whether the control should be clipped to its bounds.
Inherited from Visual
Clock IClock
Inherited from Animatable
DataContext object
Gets or sets the control's data context.
Inherited from StyledElement
DesiredSize Size
Gets the size that this element computed during the measure pass of the layout process.
Height double
Gets or sets the height of the element.
HorizontalAlignment HorizontalAlignment
Gets or sets the element's preferred horizontal alignment in its parent.
InheritanceParent IAvaloniaObject
Gets or sets the parent object that inherited AvaloniaProperty values are inherited from.
Inherited from AvaloniaObject
IsArrangeValid bool
Gets a value indicating whether the control's layouts arrange is valid.
IsEffectivelyVisible bool
Gets a value indicating whether this control and all its parents are visible.
Inherited from Visual
IsInitialized bool
Gets a value that indicates whether the element has finished initialization.
Inherited from StyledElement
IsMeasureValid bool
Gets a value indicating whether the control's layout measure is valid.
IsVisible bool
Gets a value indicating whether this control is visible.
Inherited from Visual
LogicalChildren IAvaloniaList<ILogical>
Gets the styled element's logical children.
Inherited from StyledElement
Margin Thickness
Gets or sets the margin around the element.
MaxHeight double
Gets or sets the maximum height of the element.
MaxWidth double
Gets or sets the maximum width of the element.
MinHeight double
Gets or sets the minimum height of the element.
MinWidth double
Gets or sets the minimum width of the element.
Name string
Gets or sets the name of the styled element.
Inherited from StyledElement
Opacity double
Gets the opacity of the control.
Inherited from Visual
OpacityMask IBrush
Gets the opacity mask of the control.
Inherited from Visual
Parent IStyledElement
Gets the styled element's logical parent.
Inherited from StyledElement
PseudoClasses IPseudoClasses
Gets the Classes collection in a form that allows adding and removing pseudoclasses.
Inherited from StyledElement
RenderTransform Transform
Gets the render transform of the control.
Inherited from Visual
RenderTransformOrigin RelativePoint
Gets the transform origin of the control.
Inherited from Visual
Resources IResourceDictionary
Gets or sets the styled element's resource dictionary.
Inherited from StyledElement
Styles Styles
Gets the styles for the styled element.
Inherited from StyledElement
TemplatedParent ITemplatedControl
Gets the styled element whose lookless template this styled element is part of.
Inherited from StyledElement
this[AvaloniaProperty] object
Gets or sets the value of a AvaloniaProperty.
Inherited from AvaloniaObject
this[IndexerDescriptor] IBinding
Gets or sets a binding for a AvaloniaProperty.
Inherited from AvaloniaObject
TransformedBounds TransformedBounds?
Gets the bounds of the control relative to the window, accounting for rendering transforms.
Inherited from Visual
Transitions Transitions
Gets or sets the property transitions for the control.
Inherited from Animatable
UseLayoutRounding bool
Gets or sets a value that determines whether the element should be snapped to pixel boundaries at layout time.
VerticalAlignment VerticalAlignment
Gets or sets the element's preferred vertical alignment in its parent.
VisualChildren IAvaloniaList<IVisual>
Gets the control's child visuals.
Inherited from Visual
VisualRoot IRenderRoot
Gets the root of the visual tree, if the control is attached to a visual tree.
Inherited from Visual
Width double
Gets or sets the width of the element.
ZIndex int
Gets the Z index of the control.
Inherited from Visual

Methods

Name Value Summary
AffectsArrange(AvaloniaProperty[]) void
Marks a property as affecting the control's arrangement.
static
AffectsArrange<T>(AvaloniaProperty[]) void
Marks a property as affecting the control's arrangement.
static
AffectsMeasure(AvaloniaProperty[]) void
Marks a property as affecting the control's measurement.
static
AffectsMeasure<T>(AvaloniaProperty[]) void
Marks a property as affecting the control's measurement.
static
AffectsRender(AvaloniaProperty[]) void
Indicates that a property change should cause InvalidateVisual() to be called.
Inherited from Visual
static
AffectsRender<T>(AvaloniaProperty[]) void
Indicates that a property change should cause InvalidateVisual() to be called.
Inherited from Visual
static
AffectsValidation(AvaloniaProperty, AvaloniaProperty[]) void
Forces revalidation of properties when a property value changes.
Inherited from AvaloniaObject
static
ApplyTemplate() void
Creates the visual children of the control, if necessary
Arrange(Rect) void
Arranges the control and its children.
ArrangeCore(Rect) void
The default implementation of the control's arrange pass.
ArrangeOverride(Size) Size
Positions child elements as part of a layout pass.
BeginInit() void
Inherited from StyledElement
Bind(AvaloniaProperty, IObservable<object>, BindingPriority) IDisposable
Binds a AvaloniaProperty to an observable.
Inherited from AvaloniaObject
Bind<T>(AvaloniaProperty<T>, IObservable<T>, BindingPriority) IDisposable
Binds a AvaloniaProperty to an observable.
Inherited from AvaloniaObject
CheckAccess() bool
Inherited from AvaloniaObject
ClearValue(AvaloniaProperty) void
Clears a AvaloniaProperty's local value.
Inherited from AvaloniaObject
EndInit() void
Inherited from StyledElement
GetValue(AvaloniaProperty) object
Gets a AvaloniaProperty value.
Inherited from AvaloniaObject
GetValue<T>(AvaloniaProperty<T>) T
Gets a AvaloniaProperty value.
Inherited from AvaloniaObject
InitializeIfNeeded() void
Inherited from StyledElement
InvalidateArrange() void
Invalidates the arrangement of the control and queues a new layout pass.
InvalidateMeasure() void
Invalidates the measurement of the control and queues a new layout pass.
InvalidateVisual() void
Invalidates the visual and queues a repaint.
Inherited from Visual
IsAnimating(AvaloniaProperty) bool
Checks whether a AvaloniaProperty is animating.
Inherited from AvaloniaObject
IsSet(AvaloniaProperty) bool
Checks whether a AvaloniaProperty is set on this object.
Inherited from AvaloniaObject
LogBindingError(AvaloniaProperty, Exception) void
Inherited from Visual
Measure(Size) void
Carries out a measure of the control.
MeasureCore(Size) Size
The default implementation of the control's measure pass.
MeasureOverride(Size) Size
Measures the control and its child elements as part of a layout pass.
OnAttachedToLogicalTree(LogicalTreeAttachmentEventArgs) void
Called when the styled element is added to a rooted logical tree.
Inherited from StyledElement
OnAttachedToVisualTree(VisualTreeAttachmentEventArgs) void
Called when the control is added to a visual tree.
Inherited from Visual
OnAttachedToVisualTreeCore(VisualTreeAttachmentEventArgs) void
Calls the OnAttachedToVisualTree(VisualTreeAttachmentEventArgs) method for this control and all of its visual descendants.
Inherited from Visual
OnDataContextBeginUpdate() void
Called when the DataContext begins updating.
Inherited from StyledElement
OnDataContextChanged(EventArgs) void
Called when the DataContext property changes.
Inherited from StyledElement
OnDataContextEndUpdate() void
Called when the DataContext finishes updating.
Inherited from StyledElement
OnDetachedFromLogicalTree(LogicalTreeAttachmentEventArgs) void
Called when the styled element is removed from a rooted logical tree.
Inherited from StyledElement
OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs) void
Called when the control is removed from a visual tree.
Inherited from Visual
OnDetachedFromVisualTreeCore(VisualTreeAttachmentEventArgs) void
Calls the OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs) method for this control and all of its visual descendants.
Inherited from Visual
OnMeasureInvalidated() void
Called by InvalidateMeasure
OnPropertyChanged(AvaloniaPropertyChangedEventArgs) void
Reacts to a change in a AvaloniaProperty value in order to animate the change if a ITransition is set for the property.
Inherited from Animatable
OnVisualParentChanged(IVisual, IVisual) void
Called when the control's visual parent changes.
PseudoClass(AvaloniaProperty<bool>, string) void
Adds a pseudo-class to be set when a property is true.
Inherited from StyledElement
static
PseudoClass<TOwner, TProperty>(AvaloniaProperty<TProperty>, Func<TProperty, bool>, string) void
Adds a pseudo-class to be set when a property equals a certain value.
Inherited from StyledElement
static
PseudoClass<TOwner>(AvaloniaProperty<bool>, string) void
Adds a pseudo-class to be set when a property is true.
Inherited from StyledElement
static
PseudoClass<TProperty>(AvaloniaProperty<TProperty>, Func<TProperty, bool>, string) void
Adds a pseudo-class to be set when a property equals a certain value.
Inherited from StyledElement
static
RaisePropertyChanged(AvaloniaProperty, object, object, BindingPriority) void
Raises the PropertyChanged event.
Inherited from AvaloniaObject
Render(DrawingContext) void
Renders the visual to a DrawingContext.
Inherited from Visual
Revalidate(AvaloniaProperty) void
Forces the specified property to be revalidated.
Inherited from AvaloniaObject
SetAndRaise<T>(AvaloniaProperty<T>, T, AvaloniaObject.SetAndRaiseCallback<T>, T) bool
Sets the backing field for a direct avalonia property, raising the PropertyChanged event if the value has changed.
Inherited from AvaloniaObject
SetAndRaise<T>(AvaloniaProperty<T>, T, T) bool
Sets the backing field for a direct avalonia property, raising the PropertyChanged event if the value has changed.
Inherited from AvaloniaObject
SetValue(AvaloniaProperty, object, BindingPriority) void
Sets a AvaloniaProperty value.
Inherited from AvaloniaObject
SetValue<T>(AvaloniaProperty<T>, T, BindingPriority) void
Sets a AvaloniaProperty value.
Inherited from AvaloniaObject
TransformToVisual(IVisual) Matrix?
Returns a transform that transforms the visual's coordinates into the coordinates of the specified visual.
Inherited from Visual
UpdateDataValidation(AvaloniaProperty, BindingNotification) void
Called to update the validation state for properties for which data validation is enabled.
Inherited from AvaloniaObject
VerifyAccess() void
Inherited from AvaloniaObject

Extension Methods

Name Value Summary
Bind(AvaloniaProperty, IBinding, object) IDisposable
Binds a property on an IAvaloniaObject to an IBinding.
CalculateDistanceFromAncestor(IVisual) int
Calculates the distance from a visual's IRenderRoot.
FindCommonVisualAncestor(IVisual) IVisual
Tries to get the first common ancestor of two visuals.
FindNameScope() INameScope
FindResource(string) object
Finds the specified resource by searching up the logical tree and then global styles.
GetDiagnostic(AvaloniaProperty) AvaloniaPropertyValue
Gets a diagnostic for a AvaloniaProperty on a AvaloniaObject.
GetLogicalAncestors() IEnumerable<ILogical>
GetLogicalChildren() IEnumerable<ILogical>
GetLogicalDescendants() IEnumerable<ILogical>
GetLogicalParent() ILogical
GetLogicalParent<T>() T
GetLogicalSiblings() IEnumerable<ILogical>
GetObservable(AvaloniaProperty) IObservable<object>
Gets an observable for a AvaloniaProperty.
GetObservable<T>(AvaloniaProperty<T>) IObservable<T>
Gets an observable for a AvaloniaProperty.
GetPropertyChangedObservable(AvaloniaProperty) IObservable<AvaloniaPropertyChangedEventArgs>
Gets an observable that listens for property changed events for an AvaloniaProperty.
GetResourceObservable(string) IObservable<object>
GetSelfAndLogicalAncestors() IEnumerable<ILogical>
GetSelfAndLogicalDescendants() IEnumerable<ILogical>
GetSelfAndVisualAncestors() IEnumerable<IVisual>
Enumerates an IVisual and its ancestors in the visual tree.
GetSelfAndVisualDescendants() IEnumerable<IVisual>
Enumerates an IVisual and its descendants in the visual tree.
GetSubject(AvaloniaProperty, BindingPriority) ISubject<object>
Gets a subject for a AvaloniaProperty.
GetSubject<T>(AvaloniaProperty<T>, BindingPriority) ISubject<T>
Gets a subject for a AvaloniaProperty.
GetVisualAncestors() IEnumerable<IVisual>
Enumerates the ancestors of an IVisual in the visual tree.
GetVisualAt(Point) IVisual
Gets the first visual in the visual tree whose bounds contain a point.
GetVisualChildren() IEnumerable<IVisual>
Enumerates the children of an IVisual in the visual tree.
GetVisualDescendants() IEnumerable<IVisual>
Enumerates the descendants of an IVisual in the visual tree.
GetVisualParent() IVisual
Gets the visual parent of an IVisual.
GetVisualParent<T>() T
Gets the visual parent of an IVisual.
GetVisualRoot() IRenderRoot
Gets the root visual for an IVisual.
GetVisualsAt(Point) IEnumerable<IVisual>
Enumerates the visible visuals in the visual tree whose bounds contain a point.
GetVisualsAt(Point, Func<IVisual, bool>) IEnumerable<IVisual>
Enumerates the visuals in the visual tree whose bounds contain a point.
IsLogicalParentOf(ILogical) bool
IsVisualAncestorOf(IVisual) bool
Tests whether an IVisual is an ancestor of another visual.
PointToClient(PixelPoint) Point
Converts a point from screen to client coordinates.
PointToScreen(Point) PixelPoint
Converts a point from client to screen coordinates.
TranslatePoint(Point, IVisual) Point
Translates a point relative to this visual to coordinates that are relative to the specified visual. The visual and relativeTo should be descendants of the same root window
TryFindResource(string, object) bool
Tries to the specified resource by searching up the logical tree and then global styles.