In This Article

ChromedPopup Class

A Avalonia.Controls.Primitives.Popup implementation that has built-in properties for rendering a border, background, and shadow.

public class ChromedPopup : Popup, IDataContextProvider, ILogical, IThemeVariantHost, IResourceHost, IResourceNode, IStyleHost, ISetLogicalParent, ISetInheritanceParent, IStyleable, INamed, IInputElement, IDataTemplateHost, ISetterValue, IPopupHostProvider
Inheritance:
object AvaloniaObject Animatable StyledElement Visual Layoutable Interactive InputElement Control Popup object
Implements:
IDataContextProvider ILogical IThemeVariantHost IResourceHost IResourceNode IStyleHost ISetLogicalParent ISetInheritanceParent IStyleable INamed IInputElement IDataTemplateHost ISetterValue IPopupHostProvider

Constructors

ChromedPopup()

Initializes an instance of the class.

public ChromedPopup()

Properties

AdornmentMargin

The margin thickness around the popup's shadow, which allows for adornments to extend into the transparent area of the popup.

public Thickness AdornmentMargin { get; set; }

Property Value

Thickness:

The default value is 0.

Background

Gets or sets the brush used to draw the control's background.

public IBrush? Background { get; set; }

Property Value

IBrush

BorderBrush

Gets or sets the brush used to draw the control's border.

public IBrush? BorderBrush { get; set; }

Property Value

IBrush

BorderThickness

Gets or sets the thickness of the control's border.

public Thickness BorderThickness { get; set; }

Property Value

Thickness

ChromeChild

The child Avalonia.Controls.Control that will appear within the popup's chrome.

[Content]
public Control? ChromeChild { get; set; }

Property Value

Control

CornerRadius

Gets or sets the radius of the border rounded corners.

public CornerRadius CornerRadius { get; set; }

Property Value

CornerRadius

Elevation

The elevation of the shadow, a value from 0 to 24.

public int Elevation { get; set; }

Property Value

int:

The default value is 4.

Remarks

Higher elevations render larger shadows. 0 doesn't render a shadow.

Foreground

Gets or sets a brush used to paint the text.

public IBrush? Foreground { get; set; }

Property Value

IBrush

IsShadowEnabled

Whether the shadow can be rendered by the chrome.

public bool IsShadowEnabled { get; set; }

Property Value

bool:

The default value is true.

Remarks

Set this property to false to prevent the shadow from rendering.

MaxChildHeight

The maximum height of the visible popup child control, which excludes any popup size added to render the drop shadow.

public double MaxChildHeight { get; set; }

Property Value

double

Remarks

Use this property instead of Avalonia.Layout.Layoutable.MaxHeight for accurate results.

MaxChildWidth

The maximum width of the visible popup child control, which excludes any popup size added to render the drop shadow.

public double MaxChildWidth { get; set; }

Property Value

double

Remarks

Use this property instead of Avalonia.Layout.Layoutable.MaxWidth for accurate results.

MinChildHeight

The minimum height of the visible popup child control, which excludes any popup size added to render the drop shadow.

public double MinChildHeight { get; set; }

Property Value

double

Remarks

Use this property instead of Avalonia.Layout.Layoutable.MinHeight for accurate results.

MinChildWidth

The minimum width of the visible popup child control, which excludes any popup size added to render the drop shadow.

public double MinChildWidth { get; set; }

Property Value

double

Remarks

Use this property instead of Avalonia.Layout.Layoutable.MinWidth for accurate results.

Padding

Gets or sets the padding placed between the border of the control and its content.

public Thickness Padding { get; set; }

Property Value

Thickness

ShadowColor

The shadow's color, which should be an opaque color.

public Color ShadowColor { get; set; }

Property Value

Color:

The default value is Black.

Remarks

This property is mixed with the ShadowOpacity to obtain the resolved semi-transparent color.

ShadowOpacity

The shadow's opacity, which is a percentage value in the range 0.0..1.0.

public double ShadowOpacity { get; set; }

Property Value

double:

The default value is 0.3.

Remarks

Lower property values will provide a softer shadow.

Methods

OnAttachedToLogicalTree(LogicalTreeAttachmentEventArgs)

Called when the styled element is added to a rooted logical tree.

protected override void OnAttachedToLogicalTree(LogicalTreeAttachmentEventArgs e)
Parameter Type Description
e LogicalTreeAttachmentEventArgs

The event args.

Fields

AdornmentMarginProperty

Defines the AdornmentMargin property.

public static readonly StyledProperty<Thickness> AdornmentMarginProperty

BackgroundProperty

Defines the Background property.

public static readonly StyledProperty<IBrush?> BackgroundProperty

BorderBrushProperty

Defines the BorderBrush property.

public static readonly StyledProperty<IBrush?> BorderBrushProperty

BorderThicknessProperty

Defines the BorderThickness property.

public static readonly StyledProperty<Thickness> BorderThicknessProperty

ChromeChildProperty

Defines the ChromeChild property.

public static readonly StyledProperty<Control?> ChromeChildProperty

CornerRadiusProperty

Defines the CornerRadius property.

public static readonly StyledProperty<CornerRadius> CornerRadiusProperty

ElevationProperty

Defines the Elevation property.

public static readonly StyledProperty<int> ElevationProperty

ForegroundProperty

Defines the Foreground property.

public static readonly StyledProperty<IBrush?> ForegroundProperty

IsShadowEnabledProperty

Defines the IsShadowEnabled property.

public static readonly StyledProperty<bool> IsShadowEnabledProperty

MaxChildHeightProperty

Defines the MaxChildHeight property.

public static readonly StyledProperty<double> MaxChildHeightProperty

MaxChildWidthProperty

Defines the MaxChildWidth property.

public static readonly StyledProperty<double> MaxChildWidthProperty

MinChildHeightProperty

Defines the MinChildHeight property.

public static readonly StyledProperty<double> MinChildHeightProperty

MinChildWidthProperty

Defines the MinChildWidth property.

public static readonly StyledProperty<double> MinChildWidthProperty

PaddingProperty

Defines the Padding property.

public static readonly StyledProperty<Thickness> PaddingProperty

ShadowColorProperty

Defines the ShadowColor property.

public static readonly StyledProperty<Color> ShadowColorProperty

ShadowOpacityProperty

Defines the ShadowOpacity property.

public static readonly StyledProperty<double> ShadowOpacityProperty

Inherited Members

  • Popup.WindowManagerAddShadowHintProperty
  • Popup.ChildProperty
  • Popup.InheritsTransformProperty
  • Popup.IsOpenProperty
  • Popup.PlacementAnchorProperty
  • Popup.PlacementConstraintAdjustmentProperty
  • Popup.PlacementGravityProperty
  • Popup.PlacementProperty
  • Popup.PlacementRectProperty
  • Popup.PlacementTargetProperty
  • Popup.CustomPopupPlacementCallbackProperty
  • Popup.OverlayDismissEventPassThroughProperty
  • Popup.OverlayInputPassThroughElementProperty
  • Popup.HorizontalOffsetProperty
  • Popup.IsLightDismissEnabledProperty
  • Popup.VerticalOffsetProperty
  • Popup.TopmostProperty
  • Popup.TakesFocusFromNativeControlProperty
  • Popup.Open()
  • Popup.Close()
  • Popup.GetTakesFocusFromNativeControl(Control)
  • Popup.SetTakesFocusFromNativeControl(Control, bool)
  • Popup.MeasureCore(Size)
  • Popup.OnAttachedToVisualTree(VisualTreeAttachmentEventArgs)
  • Popup.OnDetachedFromLogicalTree(LogicalTreeAttachmentEventArgs)
  • Popup.OnPropertyChanged(AvaloniaPropertyChangedEventArgs)
  • Popup.OnCreateAutomationPeer()
  • Popup.IsInsidePopup(Visual)
  • Popup.Host
  • Popup.WindowManagerAddShadowHint
  • Popup.Child
  • Popup.DependencyResolver
  • Popup.InheritsTransform
  • Popup.IsLightDismissEnabled
  • Popup.IsOpen
  • Popup.PlacementAnchor
  • Popup.PlacementConstraintAdjustment
  • Popup.PlacementGravity
  • Popup.Placement
  • Popup.PlacementRect
  • Popup.PlacementTarget
  • Popup.CustomPopupPlacementCallback
  • Popup.OverlayDismissEventPassThrough
  • Popup.OverlayInputPassThroughElement
  • Popup.HorizontalOffset
  • Popup.VerticalOffset
  • Popup.Topmost
  • Popup.TakesFocusFromNativeControl
  • Popup.IsPointerOverPopup
  • Popup.Closed
  • Popup.Opened
  • Control.FocusAdornerProperty
  • Control.TagProperty
  • Control.ContextMenuProperty
  • Control.ContextFlyoutProperty
  • Control.RequestBringIntoViewEvent
  • Control.ContextRequestedEvent
  • Control.LoadedEvent
  • Control.UnloadedEvent
  • Control.SizeChangedEvent
  • Control.GetTemplateFocusTarget()
  • Control.OnLoaded(RoutedEventArgs)
  • Control.OnUnloaded(RoutedEventArgs)
  • Control.OnSizeChanged(SizeChangedEventArgs)
  • Control.OnAttachedToVisualTreeCore(VisualTreeAttachmentEventArgs)
  • Control.OnDetachedFromVisualTreeCore(VisualTreeAttachmentEventArgs)
  • Control.OnGotFocus(GotFocusEventArgs)
  • Control.OnLostFocus(RoutedEventArgs)
  • Control.OnPointerReleased(PointerReleasedEventArgs)
  • Control.OnKeyUp(KeyEventArgs)
  • Control.FocusAdorner
  • Control.DataTemplates
  • Control.ContextMenu
  • Control.ContextFlyout
  • Control.IsLoaded
  • Control.Tag
  • Control.ContextRequested
  • Control.Loaded
  • Control.Unloaded
  • Control.SizeChanged
  • InputElement.FocusableProperty
  • InputElement.IsEnabledProperty
  • InputElement.IsEffectivelyEnabledProperty
  • InputElement.CursorProperty
  • InputElement.IsKeyboardFocusWithinProperty
  • InputElement.IsFocusedProperty
  • InputElement.IsHitTestVisibleProperty
  • InputElement.IsPointerOverProperty
  • InputElement.IsTabStopProperty
  • InputElement.GotFocusEvent
  • InputElement.LostFocusEvent
  • InputElement.KeyDownEvent
  • InputElement.KeyUpEvent
  • InputElement.TabIndexProperty
  • InputElement.TextInputEvent
  • InputElement.TextInputMethodClientRequestedEvent
  • InputElement.PointerEnteredEvent
  • InputElement.PointerExitedEvent
  • InputElement.PointerMovedEvent
  • InputElement.PointerPressedEvent
  • InputElement.PointerReleasedEvent
  • InputElement.PointerCaptureLostEvent
  • InputElement.PointerWheelChangedEvent
  • InputElement.TappedEvent
  • InputElement.HoldingEvent
  • InputElement.DoubleTappedEvent
  • InputElement.Focus(NavigationMethod, KeyModifiers)
  • InputElement.OnKeyDown(KeyEventArgs)
  • InputElement.OnTextInput(TextInputEventArgs)
  • InputElement.OnPointerEntered(PointerEventArgs)
  • InputElement.OnPointerExited(PointerEventArgs)
  • InputElement.OnPointerMoved(PointerEventArgs)
  • InputElement.OnPointerPressed(PointerPressedEventArgs)
  • InputElement.OnPointerCaptureLost(PointerCaptureLostEventArgs)
  • InputElement.OnPointerWheelChanged(PointerWheelEventArgs)
  • InputElement.UpdateIsEffectivelyEnabled()
  • InputElement.Focusable
  • InputElement.IsEnabled
  • InputElement.Cursor
  • InputElement.IsKeyboardFocusWithin
  • InputElement.IsFocused
  • InputElement.IsHitTestVisible
  • InputElement.IsPointerOver
  • InputElement.IsTabStop
  • InputElement.IsEffectivelyEnabled
  • InputElement.TabIndex
  • InputElement.KeyBindings
  • InputElement.IsEnabledCore
  • InputElement.GestureRecognizers
  • InputElement.GotFocus
  • InputElement.LostFocus
  • InputElement.KeyDown
  • InputElement.KeyUp
  • InputElement.TextInput
  • InputElement.TextInputMethodClientRequested
  • InputElement.PointerEntered
  • InputElement.PointerExited
  • InputElement.PointerMoved
  • InputElement.PointerPressed
  • InputElement.PointerReleased
  • InputElement.PointerCaptureLost
  • InputElement.PointerWheelChanged
  • InputElement.Tapped
  • InputElement.Holding
  • InputElement.DoubleTapped
  • Interactive.AddHandler(RoutedEvent, Delegate, RoutingStrategies, bool)
  • Interactive.AddHandler<TEventArgs>(RoutedEvent<TEventArgs>, EventHandler<TEventArgs>, RoutingStrategies, bool)
  • Interactive.RemoveHandler(RoutedEvent, Delegate)
  • Interactive.RemoveHandler<TEventArgs>(RoutedEvent<TEventArgs>, EventHandler<TEventArgs>)
  • Interactive.RaiseEvent(RoutedEventArgs)
  • Interactive.BuildEventRoute(RoutedEvent)
  • Layoutable.DesiredSizeProperty
  • Layoutable.WidthProperty
  • Layoutable.HeightProperty
  • Layoutable.MinWidthProperty
  • Layoutable.MaxWidthProperty
  • Layoutable.MinHeightProperty
  • Layoutable.MaxHeightProperty
  • Layoutable.MarginProperty
  • Layoutable.HorizontalAlignmentProperty
  • Layoutable.VerticalAlignmentProperty
  • Layoutable.UseLayoutRoundingProperty
  • Layoutable.UpdateLayout()
  • Layoutable.ApplyTemplate()
  • Layoutable.Measure(Size)
  • Layoutable.Arrange(Rect)
  • Layoutable.InvalidateMeasure()
  • Layoutable.InvalidateArrange()
  • Layoutable.AffectsMeasure<T>(params AvaloniaProperty[])
  • Layoutable.AffectsArrange<T>(params AvaloniaProperty[])
  • Layoutable.MeasureOverride(Size)
  • Layoutable.ArrangeCore(Rect)
  • Layoutable.ArrangeOverride(Size)
  • Layoutable.OnMeasureInvalidated()
  • Layoutable.OnVisualParentChanged(Visual, Visual)
  • Layoutable.Width
  • Layoutable.Height
  • Layoutable.MinWidth
  • Layoutable.MaxWidth
  • Layoutable.MinHeight
  • Layoutable.MaxHeight
  • Layoutable.Margin
  • Layoutable.HorizontalAlignment
  • Layoutable.VerticalAlignment
  • Layoutable.DesiredSize
  • Layoutable.IsMeasureValid
  • Layoutable.IsArrangeValid
  • Layoutable.UseLayoutRounding
  • Layoutable.EffectiveViewportChanged
  • Layoutable.LayoutUpdated
  • Visual.BoundsProperty
  • Visual.ClipToBoundsProperty
  • Visual.ClipProperty
  • Visual.IsVisibleProperty
  • Visual.OpacityProperty
  • Visual.OpacityMaskProperty
  • Visual.EffectProperty
  • Visual.HasMirrorTransformProperty
  • Visual.RenderTransformProperty
  • Visual.RenderTransformOriginProperty
  • Visual.FlowDirectionProperty
  • Visual.VisualParentProperty
  • Visual.ZIndexProperty
  • Visual.GetFlowDirection(Visual)
  • Visual.SetFlowDirection(Visual, FlowDirection)
  • Visual.InvalidateVisual()
  • Visual.Render(DrawingContext)
  • Visual.AffectsRender<T>(params AvaloniaProperty[])
  • Visual.LogicalChildrenCollectionChanged(object, NotifyCollectionChangedEventArgs)
  • Visual.OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs)
  • Visual.InvalidateMirrorTransform()
  • Visual.Bounds
  • Visual.ClipToBounds
  • Visual.Clip
  • Visual.IsEffectivelyVisible
  • Visual.IsVisible
  • Visual.Opacity
  • Visual.OpacityMask
  • Visual.Effect
  • Visual.HasMirrorTransform
  • Visual.RenderTransform
  • Visual.RenderTransformOrigin
  • Visual.FlowDirection
  • Visual.ZIndex
  • Visual.VisualChildren
  • Visual.VisualRoot
  • Visual.BypassFlowDirectionPolicies
  • Visual.AttachedToVisualTree
  • Visual.DetachedFromVisualTree
  • StyledElement.DataContextProperty
  • StyledElement.NameProperty
  • StyledElement.ParentProperty
  • StyledElement.TemplatedParentProperty
  • StyledElement.ThemeProperty
  • StyledElement.BeginInit()
  • StyledElement.EndInit()
  • StyledElement.ApplyStyling()
  • StyledElement.InitializeIfNeeded()
  • StyledElement.TryGetResource(object, ThemeVariant, out object)
  • StyledElement.OnDataContextChanged(EventArgs)
  • StyledElement.OnDataContextBeginUpdate()
  • StyledElement.OnDataContextEndUpdate()
  • StyledElement.OnInitialized()
  • StyledElement.Name
  • StyledElement.Classes
  • StyledElement.DataContext
  • StyledElement.IsInitialized
  • StyledElement.Styles
  • StyledElement.StyleKey
  • StyledElement.Resources
  • StyledElement.TemplatedParent
  • StyledElement.Theme
  • StyledElement.LogicalChildren
  • StyledElement.PseudoClasses
  • StyledElement.StyleKeyOverride
  • StyledElement.Parent
  • StyledElement.ActualThemeVariant
  • StyledElement.AttachedToLogicalTree
  • StyledElement.DetachedFromLogicalTree
  • StyledElement.DataContextChanged
  • StyledElement.Initialized
  • StyledElement.ResourcesChanged
  • StyledElement.ActualThemeVariantChanged
  • Animatable.TransitionsProperty
  • Animatable.OnPropertyChangedCore(AvaloniaPropertyChangedEventArgs)
  • Animatable.Transitions
  • AvaloniaObject.CheckAccess()
  • AvaloniaObject.VerifyAccess()
  • AvaloniaObject.ClearValue(AvaloniaProperty)
  • AvaloniaObject.ClearValue<T>(AvaloniaProperty<T>)
  • AvaloniaObject.ClearValue<T>(StyledProperty<T>)
  • AvaloniaObject.ClearValue<T>(DirectPropertyBase<T>)
  • AvaloniaObject.Equals(object)
  • AvaloniaObject.GetHashCode()
  • AvaloniaObject.GetValue(AvaloniaProperty)
  • AvaloniaObject.GetValue<T>(StyledProperty<T>)
  • AvaloniaObject.GetValue<T>(DirectPropertyBase<T>)
  • AvaloniaObject.GetBaseValue<T>(StyledProperty<T>)
  • AvaloniaObject.IsAnimating(AvaloniaProperty)
  • AvaloniaObject.IsSet(AvaloniaProperty)
  • AvaloniaObject.SetValue(AvaloniaProperty, object, BindingPriority)
  • AvaloniaObject.SetValue<T>(StyledProperty<T>, T, BindingPriority)
  • AvaloniaObject.SetValue<T>(DirectPropertyBase<T>, T)
  • AvaloniaObject.SetCurrentValue(AvaloniaProperty, object)
  • AvaloniaObject.SetCurrentValue<T>(StyledProperty<T>, T)
  • AvaloniaObject.Bind(AvaloniaProperty, IBinding)
  • AvaloniaObject.Bind(AvaloniaProperty, IObservable<object>, BindingPriority)
  • AvaloniaObject.Bind<T>(StyledProperty<T>, IObservable<object>, BindingPriority)
  • AvaloniaObject.Bind<T>(StyledProperty<T>, IObservable<T>, BindingPriority)
  • AvaloniaObject.Bind<T>(StyledProperty<T>, IObservable<BindingValue<T>>, BindingPriority)
  • AvaloniaObject.Bind<T>(DirectPropertyBase<T>, IObservable<object>)
  • AvaloniaObject.Bind<T>(DirectPropertyBase<T>, IObservable<T>)
  • AvaloniaObject.Bind<T>(DirectPropertyBase<T>, IObservable<BindingValue<T>>)
  • AvaloniaObject.CoerceValue(AvaloniaProperty)
  • AvaloniaObject.UpdateDataValidation(AvaloniaProperty, BindingValueType, Exception)
  • AvaloniaObject.RaisePropertyChanged<T>(DirectPropertyBase<T>, T, T)
  • AvaloniaObject.SetAndRaise<T>(DirectPropertyBase<T>, ref T, T)
  • AvaloniaObject.InheritanceParent
  • AvaloniaObject.this[AvaloniaProperty]
  • AvaloniaObject.this[IndexerDescriptor]
  • AvaloniaObject.PropertyChanged
  • object.GetType()
  • object.MemberwiseClone()
  • object.ToString()
  • object.Equals(object, object)
  • object.ReferenceEquals(object, object)

Extension Methods