You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Microsoft.Toolkit.Uwp.UI.Media/Shadows/AttachedCardShadow.cs
+12-1Lines changed: 12 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -5,13 +5,18 @@
5
5
usingSystem.Numerics;
6
6
usingMicrosoft.Graphics.Canvas.Geometry;
7
7
usingWindows.Foundation;
8
-
usingWindows.Foundation.Metadata;
9
8
usingWindows.UI;
10
9
usingWindows.UI.Composition;
11
10
usingWindows.UI.Xaml;
12
11
13
12
namespaceMicrosoft.Toolkit.Uwp.UI.Media
14
13
{
14
+
/// <summary>
15
+
/// A performant rectangular <see cref="DropShadow"/> which can be attached to any <see cref="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 <see cref="Style"/>.
16
+
/// </summary>
17
+
/// <remarks>
18
+
/// This shadow will not work on <see cref="FrameworkElement"/> which is directly clipping to its bounds (e.g. a <see cref="Windows.UI.Xaml.Controls.Border"/> using a <see cref="Windows.UI.Xaml.Controls.Control.CornerRadius"/>). An extra <see cref="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.
19
+
/// </remarks>
15
20
publicclassAttachedCardShadow:AttachedShadowBase
16
21
{
17
22
privateconstfloatMaxBlurRadius=72;
@@ -109,6 +114,12 @@ protected override CompositionBrush GetShadowMask(AttachedShadowElementContext c
0 commit comments