Skip to content

Commit 1bd5989

Browse files
authored
Fix3687 - card border white edges (#3691)
* add card to demo app showcasing this bug * removed Background of nested Border in the AdornerLayer * added Margin and CornerRadius to the inner Border of the AdornerDecorator in the Card, to circumvent white edges showing up around the Card
1 parent f13c495 commit 1bd5989

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

src/MainDemo.Wpf/Cards.xaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,22 @@
2424
<TextBlock Style="{StaticResource PageTitleTextBlock}" Text="Card" />
2525

2626
<WrapPanel>
27+
28+
<smtx:XamlDisplay Margin="0,0,8,8" UniqueKey="cards_11111">
29+
<Grid Background="Blue">
30+
<materialDesign:Card materialDesign:ElevationAssist.Elevation="Dp24" Margin="25" UniformCornerRadius="100" Padding="0" BorderThickness="0" >
31+
<Grid Background="Black" Height="300" Width="300" Margin="0">
32+
<TextBlock HorizontalAlignment="Center"
33+
VerticalAlignment="Center"
34+
Foreground="White"
35+
Text="The quick brown fox jumps over the lazy dog"
36+
Margin="20"
37+
TextWrapping="Wrap"/>
38+
</Grid>
39+
</materialDesign:Card>
40+
</Grid>
41+
</smtx:XamlDisplay>
42+
2743
<smtx:XamlDisplay Margin="0,0,8,8" UniqueKey="cards_1">
2844
<materialDesign:Card Width="200">
2945
<Grid>

src/MainDemo.Wpf/Properties/launchSettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"profiles": {
33
"Demo App": {
44
"commandName": "Project",
5-
"commandLineArgs": "-p Home -t Inherit -f LeftToRight"
5+
"commandLineArgs": "-p Card -t Light -f LeftToRight"
66
}
77
}
88
}

src/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Card.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
>
3535
<Border Padding="{TemplateBinding Padding}"
3636
Background="{TemplateBinding Background}"
37+
Margin="1"
38+
CornerRadius="{TemplateBinding UniformCornerRadius, Converter={x:Static converters:DoubleToCornerRadiusConverter.Instance}}"
3739
Clip="{TemplateBinding ContentClip}"/>
3840
</Border>
3941
</AdornerDecorator>

0 commit comments

Comments
 (0)