Skip to content

Commit ec8f8f9

Browse files
committed
Merge branch 'main' into winui
# Conflicts: # CommunityToolkit.WinUI.SampleApp/SamplePages/samples.json
2 parents 1427242 + 0b976f9 commit ec8f8f9

File tree

2 files changed

+47
-41
lines changed

2 files changed

+47
-41
lines changed

CommunityToolkit.WinUI.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]"

0 commit comments

Comments
 (0)