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: components/Extensions/samples/AttachedShadows.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -15,11 +15,11 @@ icon: Assets/Shadow.png
15
15
16
16
There are two types of attached shadows available today, the `AttachedCardShadow` and the `AttachedDropShadow`. It is recommended to use the `AttachedCardShadow` where possible, if you don't mind the dependency on Win2D. The `AttachedCardShadow` provides an easier to use experience that is more performant and easier to apply across an entire set of elements, assuming those elements are rounded-rectangular in shape. The `AttachedDropShadow` provides masking support and can be leveraged in any UWP app without adding an extra dependency.
17
17
18
-
###Capability Comparison
18
+
## Capability Comparison
19
19
20
20
The following table outlines the various capabilities of each shadow type in addition to comparing to the previous `DropShadowPanel` implementation:
@@ -40,7 +40,7 @@ The great benefit to the `AttachedCardShadow` is that no extra surface or elemen
40
40
41
41
## AttachedDropShadow (Composition)
42
42
43
-
The `AttachedDropShadow` provides masking support to a wide variety of elements including transparent images, shapes, and text. Masking to a custom shape that's not rectangular or rounded-rectangular is the main scenario where an `AttachedDropShadow` will be useful. Unlike it's predecessor, the [`DropShadowPanel`](../Controls/DropShadowPanel.md), the `AttachedDropShadow` doesn't need to wrap the element being shadowed; however, it does require another element to cast the shadow on to.
43
+
The `AttachedDropShadow` provides masking support to a wide variety of elements including transparent images, shapes, and text. Masking to a custom shape that's not rectangular or rounded-rectangular is the main scenario where an `AttachedDropShadow` will be useful. Unlike it's predecessor, the `DropShadowPanel`, the `AttachedDropShadow` doesn't need to wrap the element being shadowed; however, it does require another element to cast the shadow on to.
44
44
45
45
This makes it a bit more complex to use than the `AttachedCardShadow` and the `DropShadowPanel`, but since multiple `AttachedDropShadow` elements can share the same surface, this makes it much more performant than its predecessor.
Copy file name to clipboardExpand all lines: components/Extensions/samples/Shadows/AttachedDropShadowBasicSample.xaml
+1-1
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. -->
Copy file name to clipboardExpand all lines: components/Extensions/samples/Shadows/AttachedDropShadowBasicSample.xaml.cs
+1-1
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
// The .NET Foundation licenses this file to you under the MIT license.
3
3
// See the LICENSE file in the project root for more information.
4
4
5
-
namespaceExtensionsExperiment.Samples;
5
+
namespaceExtensionsExperiment.Samples.Shadows;
6
6
7
7
[ToolkitSample(id:nameof(AttachedDropShadowBasicSample),"Basic Attached Drop Shadow",description:"A sample for showing how to create an AttachedDropShadow on an element.")]
Copy file name to clipboardExpand all lines: components/Extensions/samples/Shadows/AttachedDropShadowResourceSample.xaml
+1-1
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. -->
Copy file name to clipboardExpand all lines: components/Extensions/samples/Shadows/AttachedDropShadowResourceSample.xaml.cs
+1-1
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
// The .NET Foundation licenses this file to you under the MIT license.
3
3
// See the LICENSE file in the project root for more information.
4
4
5
-
namespaceExtensionsExperiment.Samples;
5
+
namespaceExtensionsExperiment.Samples.Shadows;
6
6
7
7
[ToolkitSample(id:nameof(AttachedDropShadowResourceSample),"Attached Drop Shadow as Resource",description:"A sample for showing how to create an AttachedDropShadow on an element when defined as a resource.")]
Copy file name to clipboardExpand all lines: components/Extensions/samples/Shadows/AttachedDropShadowStyleSample.xaml
+1-1
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. -->
Copy file name to clipboardExpand all lines: components/Extensions/samples/Shadows/AttachedDropShadowStyleSample.xaml.cs
+1-1
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
// The .NET Foundation licenses this file to you under the MIT license.
3
3
// See the LICENSE file in the project root for more information.
4
4
5
-
namespaceExtensionsExperiment.Samples;
5
+
namespaceExtensionsExperiment.Samples.Shadows;
6
6
7
7
[ToolkitSample(id:nameof(AttachedDropShadowStyleSample),"Attached Drop Shadow as Style",description:"A sample for showing how to create an AttachedDropShadow when used in a Style.")]
You can see the `AttachedCardShadow` defined as a resource so it can be shared across multiple components. It also supports binding/animations to update at runtime.
24
+
25
+
## Layer Ordering
26
+
27
+
There can be cases, especially direct usage on untemplated elements, where the AttachedCardShadow may require a parent element to create the desired effect, as seen in this example:
// Licensed to the .NET Foundation under one or more agreements.
2
+
// The .NET Foundation licenses this file to you under the MIT license.
3
+
// See the LICENSE file in the project root for more information.
4
+
5
+
usingCommunityToolkit.WinUI.Media;
6
+
7
+
namespaceMediaExperiment.Samples.Shadows;
8
+
9
+
[ToolkitSample(id:nameof(AttachedCardShadowBasicSample),"Basic Attached Card Shadow",description:$"A sample for showing how to create an {nameof(AttachedCardShadow)} on an element.")]
// Licensed to the .NET Foundation under one or more agreements.
2
+
// The .NET Foundation licenses this file to you under the MIT license.
3
+
// See the LICENSE file in the project root for more information.
4
+
5
+
usingCommunityToolkit.WinUI.Media;
6
+
7
+
namespaceMediaExperiment.Samples.Shadows;
8
+
9
+
[ToolkitSample(id:nameof(AttachedCardShadowUntemplatedSample),"Untemplated Attached Card Shadow",description:$"A sample for showing how to create an {nameof(AttachedCardShadow)} on an untemplated element.")]
0 commit comments