Skip to content

Commit 2096e5d

Browse files
Fix Border based Example
1 parent 4a651dd commit 2096e5d

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

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

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,18 @@
4141
Opacity="@[Opacity:DoubleSlider:1.0:0.0-1.0]"/>
4242
</ui:Effects.Shadow>
4343
</Rectangle>
44-
<Border CornerRadius="32"
45-
Height="100" Width="100"
46-
BorderBrush="White" BorderThickness="1">
47-
<Border.Background>
48-
<ImageBrush ImageSource="ms-appx:///Assets/Photos/Owl.jpg"/>
49-
</Border.Background>
50-
<!-- TODO: Doesn't work? -->
44+
<!-- If you want to apply a shadow directly in your visual tree to an untemplated element
45+
You need to at least have a layer of depth as seen in this next example. -->
46+
<Border Height="100" Width="100">
47+
<Border CornerRadius="32"
48+
BorderBrush="White" BorderThickness="1">
49+
<Border.Background>
50+
<ImageBrush ImageSource="ms-appx:///Assets/Photos/Owl.jpg"/>
51+
</Border.Background>
52+
</Border>
53+
<!-- We need to put the Shadow on a parent element here as otherwise the
54+
rounding of the border of the image above clips the shadow itself -->
55+
<!-- TODO: This specific scenario should be simpler in the Composition based one? -->
5156
<ui:Effects.Shadow>
5257
<media:AttachedCardShadow CornerRadius="32"
5358
Offset="4,4"/>

0 commit comments

Comments
 (0)