Skip to content

Commit 760ab9f

Browse files
Merge pull request #4260 from michael-hawker/shadow-docs
Update AttachedShadow example and future doc links
2 parents 19dae10 + f7801ea commit 760ab9f

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/Shadows/AttachedShadowCompositionXaml.bind

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020

2121
<ScrollViewer>
2222
<Grid>
23-
<!-- The ShadowTarget Grid here is a *sibling* element behind where our elements which will cast
23+
<!-- The ShadowTarget Border here is a *sibling* element behind where our elements which will cast
2424
shadows are located, this is important as otherwise if we used a parent element the
2525
shadows would appear on top of our elements instead!
2626
It is also placed within the ScrollViewer here so shadows move with their elements. -->
27-
<Grid x:Name="ShadowTarget"/>
27+
<Border x:Name="ShadowTarget"/>
2828
<StackPanel Spacing="32" VerticalAlignment="Center">
2929
<!-- All buttons on this page have the shadow from the common style!
3030
The Shadow definition is Shared! -->
@@ -33,6 +33,10 @@
3333
<Image ui:Effects.Shadow="{StaticResource CommonShadow}"
3434
Height="100" Width="100"
3535
Source="ms-appx:///Assets/Photos/Owl.jpg"/>
36+
<!-- The AttachedDropShadow supports masking of text! -->
37+
<TextBlock ui:Effects.Shadow="{StaticResource CommonShadow}"
38+
Text="This is some text with a Shadow!"
39+
HorizontalAlignment="Center"/>
3640
<!-- You can still apply a Shadow directly and even use binding with it to manipulate at runtime! -->
3741
<Rectangle RadiusX="32" RadiusY="32"
3842
Height="100" Width="100"
@@ -41,8 +45,10 @@
4145
<ImageBrush ImageSource="ms-appx:///Assets/Photos/Owl.jpg"/>
4246
</Rectangle.Fill>
4347
<ui:Effects.Shadow>
48+
<!-- If doing a rectangular/rounded shadow, set IsMasked to False for better performance or switch to AttachedCardShadow -->
4449
<ui:AttachedDropShadow BlurRadius="@[BlurRadius:DoubleSlider:8.0:0.0-10.0]"
4550
CornerRadius="32"
51+
IsMasked="False"
4652
Color="@[Color:Brush:Black]"
4753
Offset="@[Offset:Vector3:4,4]"
4854
Opacity="@[Opacity:DoubleSlider:1.0:0.0-1.0]"

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/samples.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@
193193
"CodeUrl": "https://github.com/CommunityToolkit/WindowsCommunityToolkit/tree/main/Microsoft.Toolkit.Uwp.UI/Shadows",
194194
"XamlCodeFile": "/SamplePages/Shadows/AttachedShadowCompositionXaml.bind",
195195
"Icon": "/SamplePages/Shadows/DropShadowPanel.png",
196-
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/controls/DropShadowPanel.md"
196+
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/helpers/AttachedShadows.md"
197197
},
198198
{
199199
"Name": "AttachedCardShadow (Win2D)",
@@ -202,7 +202,7 @@
202202
"CodeUrl": "https://github.com/CommunityToolkit/WindowsCommunityToolkit/tree/main/Microsoft.Toolkit.Uwp.UI.Media/Shadows",
203203
"XamlCodeFile": "/SamplePages/Shadows/AttachedShadowWin2DXaml.bind",
204204
"Icon": "/SamplePages/Shadows/DropShadowPanel.png",
205-
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/controls/DropShadowPanel.md",
205+
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/helpers/AttachedShadows.md",
206206
"BadgeUpdateVersionRequired": "May 2019 update required",
207207
"ApiCheck": "Windows.UI.Composition.CompositionVisualSurface"
208208
},
@@ -670,7 +670,7 @@
670670
"CodeUrl": "https://github.com/CommunityToolkit/WindowsCommunityToolkit/tree/main/Microsoft.Toolkit.Uwp.UI.Animations/Xaml/Shadows",
671671
"XamlCodeFile": "/SamplePages/Animations/Shadows/AnimatedCardShadowXaml.bind",
672672
"Icon": "/SamplePages/Shadows/DropShadowPanel.png",
673-
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/animations/ConnectedAnimations.md"
673+
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/helpers/AttachedShadows.md"
674674
}
675675
]
676676
},

0 commit comments

Comments
 (0)