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
TopLevelimpl
IPopupImpl
PopupRoot(TopLevel, IPopupImpl, IAvaloniaDependencyResolver?)
Initializes a new instance of the PopupRoot class.
public PopupRoot(TopLevel parent, IPopupImpl impl, IAvaloniaDependencyResolver? dependencyResolver)
Parameters
parent
TopLevelThe popup parent.
impl
IPopupImplThe popup implementation.
dependencyResolver
IAvaloniaDependencyResolverThe 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
WindowManagerAddShadowHintProperty
Defines the WindowManagerAddShadowHint property.
public static readonly StyledProperty<bool> WindowManagerAddShadowHintProperty
Field Value
Properties
ParentTopLevel
public TopLevel ParentTopLevel { get; }
Property Value
PlatformImpl
Gets the platform-specific window implementation.
public IPopupImpl? PlatformImpl { get; }
Property Value
Transform
Gets or sets a transform that will be applied to the popup.
public Transform? Transform { get; set; }
Property Value
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
Methods
ArrangeSetBounds(Size)
Called during the arrange pass to set the size of the window.
protected override sealed Size ArrangeSetBounds(Size size)
Parameters
size
SizeThe 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
Visualplacement
PlacementModeoffset
Pointanchor
PopupAnchorgravity
PopupGravityconstraintAdjustment
PopupPositionerConstraintAdjustmentrect
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
SizeThe 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
AvaloniaPropertyChangedEventArgsThe 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()