AttachedCardShadow Class

Definition

A performant rectangular Windows.UI.Composition.DropShadow which can be attached to any Windows.UI.Xaml.FrameworkElement. It uses Win2D to create a clipped area of the outline of the element such that transparent elements don't see the shadow below them, and the shadow can be attached without having to project to another surface. It is animatable, can be shared via a resource, and used in a Windows.UI.Xaml.Style.

public sealed class AttachedCardShadow : Microsoft.Toolkit.Uwp.UI.AttachedShadowBase
type AttachedCardShadow = class
    inherit AttachedShadowBase
Public NotInheritable Class AttachedCardShadow
Inherits AttachedShadowBase
Inheritance
Windows.UI.Xaml.DependencyObject
AttachedCardShadow

Remarks

This shadow will not work on Windows.UI.Xaml.FrameworkElement which is directly clipping to its bounds (e.g. a Windows.UI.Xaml.Controls.Border using a Windows.UI.Xaml.Controls.Control.CornerRadius). An extra Windows.UI.Xaml.Controls.Border can instead be applied around the clipped border with the Shadow to create the desired effect. Most existing controls due to how they're templated will not encounter this behavior or require this workaround.

Constructors

AttachedCardShadow()

Fields

CornerRadiusProperty

The Windows.UI.Xaml.DependencyProperty for CornerRadius

Properties

BlurRadius

Gets or sets the blur radius of the shadow.

(Inherited from AttachedShadowBase)
Color

Gets or sets the color of the shadow.

(Inherited from AttachedShadowBase)
CornerRadius

Gets or sets the roundness of the shadow's corners.

IsSupported

Gets a value indicating whether or not this AttachedShadowBase implementation is supported on the current platform.

Offset

Gets or sets the offset of the shadow as a string representation of a Vector3.

(Inherited from AttachedShadowBase)
Opacity

Gets or sets the opacity of the shadow.

(Inherited from AttachedShadowBase)
SupportsOnSizeChangedEvent

Gets a value indicating whether or not OnSizeChanged should be called when Windows.UI.Xaml.FrameworkElement.SizeChanged is fired.

(Inherited from AttachedShadowBase)

Methods

EnumerateElementContexts()

Gets an enumeration over the current list of AttachedShadowElementContext of elements using this shared shadow definition.

(Inherited from AttachedShadowBase)
GetElementContext(FrameworkElement)

Get the associated AttachedShadowElementContext for the specified Windows.UI.Xaml.FrameworkElement.

(Inherited from AttachedShadowBase)
GetShadowClip(AttachedShadowElementContext)

Get the Windows.UI.Composition.CompositionClip for the shadow's Windows.UI.Composition.SpriteVisual

(Inherited from AttachedShadowBase)
GetShadowMask(AttachedShadowElementContext)

Get a Windows.UI.Composition.CompositionBrush in the shape of the element that is casting the shadow.

(Inherited from AttachedShadowBase)
OnElementContextInitialized(AttachedShadowElementContext)

Override to handle when the AttachedShadowElementContext for an element is being initialized.

(Inherited from AttachedShadowBase)
OnElementContextUninitialized(AttachedShadowElementContext)

Override to handle when the AttachedShadowElementContext for an element is being uninitialized.

(Inherited from AttachedShadowBase)
OnPropertyChanged(AttachedShadowElementContext, DependencyProperty, Object, Object)

This method is called when a DependencyProperty is changed.

(Inherited from AttachedShadowBase)
OnSizeChanged(AttachedShadowElementContext, Size, Size)

This method is called when the element size changes, and SupportsOnSizeChangedEvent = true.

(Inherited from AttachedShadowBase)
SetElementChildVisual(AttachedShadowElementContext)

Sets SpriteVisual as a child visual on Element

(Inherited from AttachedShadowBase)
UpdateShadowClip(AttachedShadowElementContext)

Update the clipping on the shadow's Windows.UI.Composition.SpriteVisual.

(Inherited from AttachedShadowBase)
UpdateShadowMask(AttachedShadowElementContext)

Update the mask that gives the shadow its shape.

(Inherited from AttachedShadowBase)

Applies to