Table of Contents

Class PopupRoot

Namespace
Avalonia.Controls.Primitives
Assembly
Avalonia.Controls.dll

The root window of a Popup.

public sealed class PopupRoot : WindowBase, INotifyPropertyChanged, IDataContextProvider, IThemeVariantHost, IResourceHost, IResourceNode, ISetLogicalParent, ISetInheritanceParent, ISupportInitialize, IStyleable, INamed, IDataTemplateHost, ISetterValue, ILayoutRoot, IRenderRoot, ICloseable, ILogicalRoot, ILogical, ITextInputMethodRoot, IInputRoot, IInputElement, IHostedVisualTreeRoot, IStyleHost, IPopupHost, IDisposable, IFocusScope
Inheritance
PopupRoot
Implements
Inherited Members
Extension Methods

Constructors

PopupRoot(TopLevel, IPopupImpl)

Initializes a new instance of the PopupRoot class.

public PopupRoot(TopLevel parent, IPopupImpl impl)

Parameters

parent TopLevel
impl IPopupImpl

PopupRoot(TopLevel, IPopupImpl, IAvaloniaDependencyResolver?)

Initializes a new instance of the PopupRoot class.

public PopupRoot(TopLevel parent, IPopupImpl impl, IAvaloniaDependencyResolver? dependencyResolver)

Parameters

parent TopLevel

The popup parent.

impl IPopupImpl

The popup implementation.

dependencyResolver IAvaloniaDependencyResolver

The dependency resolver to use. If null the default dependency resolver will be used.

Fields

TransformProperty

Defines the Transform property.

public static readonly StyledProperty<Transform?> TransformProperty

Field Value

StyledProperty<Transform>

WindowManagerAddShadowHintProperty

Defines the WindowManagerAddShadowHint property.

public static readonly StyledProperty<bool> WindowManagerAddShadowHintProperty

Field Value

StyledProperty<bool>

Properties

ParentTopLevel

public TopLevel ParentTopLevel { get; }

Property Value

TopLevel

PlatformImpl

Gets the platform-specific window implementation.

public IPopupImpl? PlatformImpl { get; }

Property Value

IPopupImpl

Transform

Gets or sets a transform that will be applied to the popup.

public Transform? Transform { get; set; }

Property Value

Transform

WindowManagerAddShadowHint

Gets or sets a hint to the window manager that a shadow should be added to the popup.

public bool WindowManagerAddShadowHint { get; set; }

Property Value

bool

Methods

ArrangeSetBounds(Size)

Called during the arrange pass to set the size of the window.

protected override sealed Size ArrangeSetBounds(Size size)

Parameters

size Size

The requested size of the window.

Returns

Size

The actual size of the window.

ConfigurePosition(Visual, PlacementMode, Point, PopupAnchor, PopupGravity, PopupPositionerConstraintAdjustment, Rect?)

[Unstable("This API may be removed in Avalonia 12. If you depend on this API, please open an issue with details of your use-case.")]
public void ConfigurePosition(Visual target, PlacementMode placement, Point offset, PopupAnchor anchor = PopupAnchor.None, PopupGravity gravity = PopupGravity.None, PopupPositionerConstraintAdjustment constraintAdjustment = PopupPositionerConstraintAdjustment.All, Rect? rect = null)

Parameters

target Visual
placement PlacementMode
offset Point
anchor PopupAnchor
gravity PopupGravity
constraintAdjustment PopupPositionerConstraintAdjustment
rect Rect?

Dispose()

public void Dispose()

MeasureOverride(Size)

Measures the control and its child elements as part of a layout pass.

protected override Size MeasureOverride(Size availableSize)

Parameters

availableSize Size

The size available to the control.

Returns

Size

The desired size for the control.

OnCreateAutomationPeer()

Returns a new, type-specific AutomationPeer implementation for the control.

protected override AutomationPeer OnCreateAutomationPeer()

Returns

AutomationPeer

The type-specific AutomationPeer implementation.

OnPropertyChanged(AvaloniaPropertyChangedEventArgs)

Called when a avalonia property changes on the object.

protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)

Parameters

change AvaloniaPropertyChangedEventArgs

The property change details.

SetChild(Control?)

Sets the control to display in the popup.

public void SetChild(Control? control)

Parameters

control Control

TakeFocus()

Takes focus from any currently focused native control.

public void TakeFocus()