Skip to content

Commit de2b351

Browse files
committed
Merge branch 'separator-on-colored-background' of https://github.com/mgnslndh/MaterialDesignInXamlToolkit into mgnslndh-separator-on-colored-background
2 parents 8fdc9de + 5f6d51a commit de2b351

File tree

3 files changed

+46
-5
lines changed

3 files changed

+46
-5
lines changed

MainDemo.Wpf/Cards.xaml

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<ResourceDictionary>
1111
<ResourceDictionary.MergedDictionaries>
1212
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Button.xaml" />
13+
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Card.xaml" />
1314
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.CheckBox.xaml" />
1415
</ResourceDictionary.MergedDictionaries>
1516
</ResourceDictionary>
@@ -44,19 +45,47 @@
4445
</StackPanel>
4546
</Grid>
4647
</materialDesign:Card>
48+
<materialDesign:Card Margin="4 4 0 0" Background="#03a9f4"
49+
Foreground="{DynamicResource PrimaryHueDarkForegroundBrush}"
50+
Padding="0"
51+
Width="200">
52+
<Grid>
53+
<Grid.RowDefinitions>
54+
<RowDefinition Height="Auto" />
55+
<RowDefinition Height="Auto" />
56+
<RowDefinition Height="Auto" />
57+
</Grid.RowDefinitions>
58+
<TextBlock Grid.Row="0" Margin="16 16 16 4" Style="{StaticResource MaterialDesignHeadlineTextBlock}">Call Jennifer</TextBlock>
59+
<Separator Grid.Row="1" Style="{StaticResource MaterialDesignDarkSeparator}"/>
60+
<TextBlock Grid.Row="2" Margin="16 0 16 8" VerticalAlignment="Center" HorizontalAlignment="Left" Style="{StaticResource MaterialDesignBody1TextBlock}">March 19, 2016</TextBlock>
61+
<StackPanel Grid.Row="2" Orientation="Horizontal" Margin="16 0 16 8" HorizontalAlignment="Right">
62+
<Button HorizontalAlignment="Right" Style="{StaticResource MaterialDesignToolForegroundButton}" Width="30" Padding="2 0 2 0"
63+
materialDesign:RippleAssist.IsCentered="True">
64+
<materialDesign:PackIcon Kind="Phone" />
65+
</Button>
66+
</StackPanel>
67+
</Grid>
68+
</materialDesign:Card>
4769
<materialDesign:Card Margin="4 4 0 0" Background="{DynamicResource PrimaryHueLightBrush}"
4870
Foreground="{DynamicResource PrimaryHueLightForegroundBrush}"
4971
Padding="8">
5072
<TextBlock FontSize="16">Boring Text</TextBlock>
5173
</materialDesign:Card>
5274
<materialDesign:Card Margin="4 4 0 0" Background="{DynamicResource PrimaryHueDarkBrush}"
5375
Foreground="{DynamicResource PrimaryHueDarkForegroundBrush}"
54-
Padding="8">
76+
>
5577
<StackPanel>
56-
<TextBlock FontSize="16">Notes</TextBlock>
57-
<CheckBox Margin="0 4 0 0" Style="{StaticResource MaterialDesignUserForegroundCheckBox}">Do something good</CheckBox>
58-
<CheckBox Style="{StaticResource MaterialDesignUserForegroundCheckBox}">Take a breather</CheckBox>
59-
<CheckBox Style="{StaticResource MaterialDesignUserForegroundCheckBox}">And go create</CheckBox>
78+
<TextBlock Margin="16 16 12 8" FontSize="16">Notes</TextBlock>
79+
<CheckBox Margin="16 4 16 0" Style="{StaticResource MaterialDesignUserForegroundCheckBox}">Do something good</CheckBox>
80+
<CheckBox Margin="16 4 16 0" Style="{StaticResource MaterialDesignUserForegroundCheckBox}">Take a breather</CheckBox>
81+
<CheckBox Margin="16 4 16 0" Style="{StaticResource MaterialDesignUserForegroundCheckBox}">And go create</CheckBox>
82+
<Separator Style="{StaticResource MaterialDesignLightSeparator}"/>
83+
<StackPanel Margin="8 0 8 8" Orientation="Horizontal" HorizontalAlignment="Right">
84+
<Button HorizontalAlignment="Right" Style="{StaticResource MaterialDesignToolForegroundButton}" Width="30" Padding="2 0 0 0"
85+
materialDesign:RippleAssist.IsCentered="True">
86+
<materialDesign:PackIcon Kind="CheckAll" />
87+
</Button>
88+
</StackPanel>
6089
</StackPanel>
6190
</materialDesign:Card>
6291
<materialDesign:Card Margin="4 4 0 0" Background="{DynamicResource PrimaryHueDarkBrush}"

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Card.xaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,14 @@
4040
<Setter Property="wpf:ShadowAssist.ShadowDepth" Value="Depth2" />
4141
</Style>
4242

43+
<Style x:Key="MaterialDesignDarkSeparator" TargetType="{x:Type Separator}" BasedOn="{StaticResource MaterialDesignSeparator}">
44+
<Setter Property="Background" Value="{DynamicResource MaterialDesignDarkSeparatorBackground}"/>
45+
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignDarkSeparatorBackground}"/>
46+
</Style>
47+
48+
<Style x:Key="MaterialDesignLightSeparator" TargetType="{x:Type Separator}" BasedOn="{StaticResource MaterialDesignSeparator}">
49+
<Setter Property="Background" Value="{DynamicResource MaterialDesignLightSeparatorBackground}"/>
50+
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignLightSeparatorBackground}"/>
51+
</Style>
52+
4353
</ResourceDictionary>

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Defaults.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
<SolidColorBrush x:Key="MaterialDesignLightForeground" Color="#DD000000"/>
4141
<SolidColorBrush x:Key="MaterialDesignDarkBackground" Color="#FF37474f"/>
4242
<SolidColorBrush x:Key="MaterialDesignDarkForeground" Color="#FFFAFAFA"/>
43+
<SolidColorBrush x:Key="MaterialDesignDarkSeparatorBackground" Color="#1F000000" />
44+
<SolidColorBrush x:Key="MaterialDesignLightSeparatorBackground" Color="#1FFFFFFF" />
4345
<Style TargetType="{x:Type Button}" BasedOn="{StaticResource MaterialDesignRaisedButton}" />
4446
<Style TargetType="{x:Type Calendar}" BasedOn="{StaticResource MaterialDesignCalendarPortrait}" />
4547
<Style TargetType="{x:Type CheckBox}" BasedOn="{StaticResource MaterialDesignCheckBox}" />

0 commit comments

Comments
 (0)