Skip to content

Commit aad5839

Browse files
Use ImageBrush as resource instead of on each border to work around a WinAppSDK issue with image disappearing
TODO: Should investigate a minimal repro to file against the WinAppSDK
1 parent 90559b8 commit aad5839

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

components/TransitionHelper/samples/TransitionHelperFullExample.xaml

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
<labs:TransitionConfig EnableClipAnimation="true"
2525
Id="desc" />
2626
</labs:TransitionHelper>
27+
28+
<ImageBrush x:Key="ImageBackgroundBrush"
29+
ImageSource="ms-appx:///Assets/Owl.jpg" />
2730
</Page.Resources>
2831
<Grid>
2932
<StackPanel x:Name="FirstControl"
@@ -40,11 +43,8 @@
4043
<Border Width="36"
4144
Height="36"
4245
labs:TransitionHelper.Id="image"
43-
CornerRadius="18">
44-
<Border.Background>
45-
<ImageBrush ImageSource="ms-appx:///Assets/Owl.jpg" />
46-
</Border.Background>
47-
</Border>
46+
Background="{StaticResource ImageBackgroundBrush}"
47+
CornerRadius="18" />
4848
</Grid>
4949
<StackPanel labs:TransitionHelper.Id="guide"
5050
Spacing="2">
@@ -86,11 +86,8 @@
8686
<Border Width="50"
8787
Height="50"
8888
labs:TransitionHelper.Id="image"
89-
CornerRadius="25">
90-
<Border.Background>
91-
<ImageBrush ImageSource="ms-appx:///Assets/Owl.jpg" />
92-
</Border.Background>
93-
</Border>
89+
Background="{StaticResource ImageBackgroundBrush}"
90+
CornerRadius="25" />
9491
<StackPanel Width="400"
9592
VerticalAlignment="Center"
9693
Spacing="5">
@@ -146,11 +143,8 @@
146143
<Border Width="80"
147144
Height="80"
148145
labs:TransitionHelper.Id="image"
149-
CornerRadius="40">
150-
<Border.Background>
151-
<ImageBrush ImageSource="ms-appx:///Assets/Owl.jpg" />
152-
</Border.Background>
153-
</Border>
146+
Background="{StaticResource ImageBackgroundBrush}"
147+
CornerRadius="40" />
154148
<StackPanel Spacing="5">
155149
<TextBlock MaxWidth="200"
156150
HorizontalAlignment="Center"

0 commit comments

Comments
 (0)