Renders a drop-shadow around child content.
- Inheritance:
- object AvaloniaObject Animatable StyledElement Visual Layoutable Interactive InputElement Control object
- Implements:
- IDataContextProvider ILogical IThemeVariantHost IResourceHost IResourceNode IStyleHost ISetLogicalParent ISetInheritanceParent IStyleable INamed IInputElement IDataTemplateHost ISetterValue
Constructors
ShadowChrome()
Initializes an instance of the class.
Properties
Background
Gets or sets a brush with which to paint the background.
Property Value
- IBrush
Child
The child Avalonia.Controls.Control to surround with a shadow.
Property Value
- Control
Elevation
The elevation of the shadow, a value from 0
to 24
.
Property Value
- int:
The default value is
4
.
Remarks
Higher elevations render larger shadows.
0
doesn't render a shadow.
IsAnimationEnabled
Whether animation is enabled.
Property Value
- bool:
The default value is
true
.
IsShadowEnabled
Whether the shadow can be rendered by the chrome.
Property Value
- bool:
The default value is
true
.
Remarks
Set this property to false
to prevent the shadow from rendering.
Padding
Gets or sets the padding placed between the border of the control and its content.
Property Value
- Thickness
ShadowColor
The shadow's color, which should be an opaque color.
Property Value
- Color:
The default value is
Black
.
Remarks
This property is mixed with the Shadow
ShadowOpacity
The shadow's opacity, which is a percentage value in the range 0.0
..1.0
.
Property Value
- double:
The default value is
0.3
.
Remarks
Lower property values will provide a softer shadow.
ShadowThickness
The resolved shadow Avalonia.Thickness.
Property Value
- Thickness
Remarks
When used as a Avalonia.Controls.Primitives.Popup shadow, the popup may wish to increase its size by this amount to ensure the shadow can render.
Methods
ArrangeOverride(Size)
Positions child elements as part of a layout pass.
Parameter | Type | Description |
---|---|---|
finalSize | Size | The size available to the control. |
Returns
- Size:
The actual size used.
GetShadowThickness(double, int)
Returns the shadow thickness for the specified direction and elevation.
Parameter | Type | Description |
---|---|---|
direction | double | The direction angle value, expressed in degrees. |
elevation | int | The elevation. |
Returns
- Thickness
MeasureOverride(Size)
Measures the control and its child elements as part of a layout pass.
Parameter | Type | Description |
---|---|---|
availableSize | Size | The size available to the control. |
Returns
- Size:
The desired size for the control.
Render(DrawingContext)
Renders the visual to a Avalonia.Media.DrawingContext.
Parameter | Type | Description |
---|---|---|
context | DrawingContext | The drawing context. |
Fields
BackgroundProperty
Defines the Background property.
ChildProperty
Defines the Child property.
DefaultDirection
The default direction.
DefaultElevation
The Elevation value for a default shadow.
ElevationProperty
Defines the Elevation property.
IsAnimationEnabledProperty
Defines the Is
IsShadowEnabledProperty
Defines the Is
MaxElevation
The maximum Elevation value of 24
.
MinElevation
The minimum Elevation value of 0
.
PaddingProperty
Defines the Padding property.
PopupElevation
The Elevation value for a popup shadow.
ShadowColorProperty
Defines the Shadow
ShadowOpacityProperty
Defines the Shadow
ShadowThicknessProperty
Defines the Shadow
Inherited Members
- 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.OnCreateAutomationPeer()
- Control.OnPointerReleased(PointerReleasedEventArgs)
- Control.OnKeyUp(KeyEventArgs)
- Control.OnPropertyChanged(AvaloniaPropertyChangedEventArgs)
- 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.
Add Handler(Routed Event, Delegate, Routing Strategies, bool) - Interactive.AddHandler<TEventArgs>(RoutedEvent<TEventArgs>, EventHandler<TEventArgs>, RoutingStrategies, bool)
-
Interactive.
Remove Handler(Routed Event, 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.MeasureCore(Size)
- Layoutable.ArrangeCore(Rect)
- 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.AffectsRender<T>(params AvaloniaProperty[])
-
Visual.
Logical Children Collection Changed(object, Notify Collection Changed Event Args) - Visual.OnAttachedToVisualTree(VisualTreeAttachmentEventArgs)
- 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()
-
Styled
Element. Try Get Resource(object, Theme Variant, out object) - StyledElement.OnAttachedToLogicalTree(LogicalTreeAttachmentEventArgs)
- StyledElement.OnDetachedFromLogicalTree(LogicalTreeAttachmentEventArgs)
-
Styled
Element. On Data Context Changed(Event Args) - 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>)
-
Avalonia
Object. 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)
-
Avalonia
Object. Set Value(Avalonia Property, object, Binding Priority) - AvaloniaObject.SetValue<T>(StyledProperty<T>, T, BindingPriority)
- AvaloniaObject.SetValue<T>(DirectPropertyBase<T>, T)
-
Avalonia
Object. Set Current Value(Avalonia Property, 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)
-
Avalonia
Object. Update Data Validation(Avalonia Property, Binding Value Type, 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.
Get Type() -
object.
Memberwise Clone() -
object.
To String() -
object.
Equals(object, object) -
object.
Reference Equals(object, object)
Extension Methods
-
Avalonia
Object Extensions. Bind To Property(Avalonia Object, Avalonia Property, Avalonia Object, Avalonia Property, Binding Mode) -
Avalonia
Object Extensions. Bind To Property(Avalonia Object, Avalonia Property, object, Avalonia Property, Binding Mode, IValue Converter, object) -
Visual
Extensions. Get First Focusable Visual Descendant(Visual) -
Visual
Extensions. Invalidate Measure For All Visuals In Same Template(Visual) - VisualExtensions.InvalidateMeasureForVisualAncestorPath<PathEndType>(Visual, bool)
-
Object
Extensions. Try Convert To Double(object, out double) -
Object
Extensions. Try Convert To Double(object, IFormat Provider, out double)