Skip to content

Commit ae09772

Browse files
committed
Merge branch 'master' of https://github.com/bebenins/MaterialDesignInXamlToolkit into bebenins-master
2 parents 9048f26 + 882b8e1 commit ae09772

8 files changed

+99
-74
lines changed

MainDemo.Wpf/Buttons.xaml

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -314,49 +314,6 @@
314314
<materialDesign:PackIcon Kind="FormatAlignJustify"/>
315315
</ListBoxItem>
316316
</ListBox>
317-
318-
<ListBox Grid.Column="1" Grid.Row="1" Style="{StaticResource MaterialDesignToolToggleFlatListBox}" SelectedIndex="0">
319-
<ListBox.ToolTip>
320-
<StackPanel>
321-
<TextBlock Text="MaterialDesignToolToggleFlatListBox" />
322-
<TextBlock Text="Exclusive selection" />
323-
<TextBlock Text="ListBoxAssist.IsToggle allows more natural toggle behaviour" />
324-
</StackPanel>
325-
</ListBox.ToolTip>
326-
<ListBoxItem>
327-
<materialDesign:PackIcon Kind="FormatAlignLeft"/>
328-
</ListBoxItem>
329-
<ListBoxItem>
330-
<materialDesign:PackIcon Kind="FormatAlignCenter"/>
331-
</ListBoxItem>
332-
<ListBoxItem>
333-
<materialDesign:PackIcon Kind="FormatAlignRight"/>
334-
</ListBoxItem>
335-
<ListBoxItem>
336-
<materialDesign:PackIcon Kind="FormatAlignJustify"/>
337-
</ListBoxItem>
338-
</ListBox>
339-
340-
<ListBox Grid.Column="1" Grid.Row="2" Style="{StaticResource MaterialDesignToolToggleListBox}"
341-
SelectionMode="Extended"
342-
Margin="0 8 0 0">
343-
<ListBox.ToolTip>
344-
<StackPanel>
345-
<TextBlock Text="MaterialDesignToolToggleListBox" />
346-
<TextBlock Text="Multiple selection" />
347-
<TextBlock Text="ListBoxAssist.IsToggle allows more natural toggle behaviour" />
348-
</StackPanel>
349-
</ListBox.ToolTip>
350-
<ListBoxItem>
351-
<materialDesign:PackIcon Kind="FormatBold"/>
352-
</ListBoxItem>
353-
<ListBoxItem>
354-
<materialDesign:PackIcon Kind="FormatItalic"/>
355-
</ListBoxItem>
356-
<ListBoxItem x:Name="UnderlineCheckbox">
357-
<materialDesign:PackIcon Kind="FormatUnderline"/>
358-
</ListBoxItem>
359-
</ListBox>
360317
</Grid>
361318

362319
<Border Grid.Row="6" Margin="0 16 0 0" BorderThickness="0 1 0 0" BorderBrush="{DynamicResource MaterialDesignDivider}" />

MainDemo.Wpf/MenusAndToolBars.xaml

Lines changed: 49 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,54 @@
6969
<Button Command="Paste" ToolTip="Paste some stuff" ToolBar.OverflowMode="AsNeeded">
7070
<materialDesign:PackIcon Kind="ContentPaste" />
7171
</Button>
72-
<Separator />
72+
<Separator/>
73+
<ListBox Style="{StaticResource MaterialDesignToolToggleFlatListBox}">
74+
<ListBoxItem ToolTip="This is a lonley toggle with TextBlock instead of icon">
75+
<TextBlock>W</TextBlock>
76+
</ListBoxItem>
77+
</ListBox>
78+
<Separator/>
79+
<ListBox Style="{StaticResource MaterialDesignToolToggleFlatListBox}" SelectedIndex="0">
80+
<ListBox.ToolTip>
81+
<StackPanel>
82+
<TextBlock Text="MaterialDesignToolToggleFlatListBox" />
83+
<TextBlock Text="Exclusive selection" />
84+
<TextBlock Text="ListBoxAssist.IsToggle allows more natural toggle behaviour" />
85+
</StackPanel>
86+
</ListBox.ToolTip>
87+
<ListBoxItem >
88+
<materialDesign:PackIcon Kind="FormatAlignLeft"/>
89+
</ListBoxItem>
90+
<ListBoxItem>
91+
<materialDesign:PackIcon Kind="FormatAlignCenter"/>
92+
</ListBoxItem>
93+
<ListBoxItem>
94+
<materialDesign:PackIcon Kind="FormatAlignRight"/>
95+
</ListBoxItem>
96+
<ListBoxItem>
97+
<materialDesign:PackIcon Kind="FormatAlignJustify"/>
98+
</ListBoxItem>
99+
</ListBox>
100+
<Separator/>
101+
<ListBox SelectionMode="Extended" Style="{StaticResource MaterialDesignToolToggleFlatListBox}">
102+
<ListBox.ToolTip>
103+
<StackPanel>
104+
<TextBlock Text="MaterialDesignToolToggleListBox" />
105+
<TextBlock Text="Multiple selection" />
106+
<TextBlock Text="ListBoxAssist.IsToggle allows more natural toggle behaviour" />
107+
</StackPanel>
108+
</ListBox.ToolTip>
109+
<ListBoxItem>
110+
<materialDesign:PackIcon Kind="FormatBold"/>
111+
</ListBoxItem>
112+
<ListBoxItem>
113+
<materialDesign:PackIcon Kind="FormatItalic"/>
114+
</ListBoxItem>
115+
<ListBoxItem x:Name="UnderlineCheckbox">
116+
<materialDesign:PackIcon Kind="FormatUnderline"/>
117+
</ListBoxItem>
118+
</ListBox>
119+
<Separator/>
73120
<Label Content="Font size:" VerticalAlignment="Center"/>
74121
<ComboBox>
75122
<ComboBoxItem Content="10"/>
@@ -85,12 +132,7 @@
85132
</Button>
86133
<RadioButton GroupName="XXX" Content="Radio" />
87134
<RadioButton GroupName="XXX" Content="Ga Ga" />
88-
<ToggleButton>
89-
Switch
90-
</ToggleButton>
91-
<Menu>
92-
<MenuItem>Embedded menu</MenuItem>
93-
</Menu>
135+
<ToggleButton/>
94136
</ToolBar>
95137
</ToolBarTray>
96138

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Dark.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<SolidColorBrush x:Key="MaterialDesignBackground" Color="#FF000000" po:Freeze="True" />
99
<SolidColorBrush x:Key="MaterialDesignPaper" Color="#FF303030" po:Freeze="True" />
1010
<SolidColorBrush x:Key="MaterialDesignCardBackground" Color="#FF424242" po:Freeze="True" />
11+
<SolidColorBrush x:Key="MaterialDesignToolBarBackground" Color="#FF212121" po:Freeze="True" />
1112
<SolidColorBrush x:Key="MaterialDesignBody" Color="#DDFFFFFF" po:Freeze="True" />
1213
<SolidColorBrush x:Key="MaterialDesignBodyLight" Color="#89FFFFFF" po:Freeze="True" />
1314
<SolidColorBrush x:Key="MaterialDesignColumnHeader" Color="#BCFFFFFF" po:Freeze="True" /><!-- 74% -->

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Light.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<SolidColorBrush x:Key="MaterialDesignBackground" Color="#FFFFFFFF" po:Freeze="True" />
99
<SolidColorBrush x:Key="MaterialDesignPaper" Color="#FFfafafa" po:Freeze="True" />
1010
<SolidColorBrush x:Key="MaterialDesignCardBackground" Color="#FFFFFFFF" po:Freeze="True" />
11+
<SolidColorBrush x:Key="MaterialDesignToolBarBackground" Color="#FFF5F5F5" po:Freeze="True" />
1112
<SolidColorBrush x:Key="MaterialDesignBody" Color="#DD000000" po:Freeze="True" />
1213
<SolidColorBrush x:Key="MaterialDesignBodyLight" Color="#89000000" po:Freeze="True" />
1314
<SolidColorBrush x:Key="MaterialDesignColumnHeader" Color="#BC000000" po:Freeze="True" /> <!-- 74% -->

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.ListBox.xaml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,12 @@
2626
<Setter Property="Background" Value="Transparent"/>
2727
<Setter Property="BorderThickness" Value="0"/>
2828
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignDivider}"/>
29-
<Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
29+
<Setter Property="TextBlock.FontWeight" Value="DemiBold"/>
30+
<Setter Property="TextBlock.FontSize" Value="18"/>
31+
<Setter Property="MinWidth" Value="54"/>
32+
<Setter Property="HorizontalContentAlignment" Value="Center"/>
3033
<Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
31-
<Setter Property="Padding" Value="14 6 14 6" />
34+
<Setter Property="Padding" Value="16" />
3235
<Setter Property="SnapsToDevicePixels" Value="True"/>
3336
<Setter Property="Template">
3437
<Setter.Value>
@@ -103,7 +106,7 @@
103106
</VisualState>
104107
</VisualStateGroup>
105108
</VisualStateManager.VisualStateGroups>
106-
<Grid Margin="0 0 -1 0">
109+
<Grid>
107110
<Border x:Name="MouseOverBorder"
108111
Opacity="0"
109112
Background="{TemplateBinding Foreground, Converter={StaticResource BrushRoundConverter}}"/>
@@ -120,12 +123,11 @@
120123
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
121124
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
122125
Padding="{TemplateBinding Padding}">
123-
124126
</wpf:Ripple>
125127
<Border x:Name="SelectedBorder"
126128
Visibility="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=ListBox}, Path=SelectionMode, Converter={StaticResource EqualityToVisibilityConverter}, ConverterParameter={x:Static SelectionMode.Extended}, Mode=OneWay}"
127129
Opacity="0"
128-
BorderThickness="1 0 1 0"
130+
BorderThickness="0"
129131
BorderBrush="{DynamicResource MaterialDesignDivider}" />
130132
</Grid>
131133
</Border>
@@ -178,7 +180,7 @@
178180
Background="{TemplateBinding Background}"
179181
SnapsToDevicePixels="true"
180182
Padding="{TemplateBinding Padding}">
181-
<wpf:Card wpf:ShadowAssist.ShadowDepth="{TemplateBinding wpf:ShadowAssist.ShadowDepth}" HorizontalAlignment="Left">
183+
<wpf:Card wpf:ShadowAssist.ShadowDepth="{TemplateBinding wpf:ShadowAssist.ShadowDepth}" HorizontalAlignment="Left" Background="{DynamicResource MaterialDesignToolBarBackground}">
182184
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
183185
</wpf:Card>
184186
</Border>
@@ -205,7 +207,7 @@
205207
<Setter Property="BorderThickness" Value="0"/>
206208
<Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
207209
<Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
208-
<Setter Property="Padding" Value="8" />
210+
<Setter Property="Padding" Value="8"/>
209211
<Setter Property="SnapsToDevicePixels" Value="True"/>
210212
<Setter Property="Template">
211213
<Setter.Value>
@@ -343,8 +345,7 @@
343345
</Setter>
344346
</Style>
345347

346-
<Style x:Key="MaterialDesignCardsListBox" TargetType="{x:Type ListBox}"
347-
BasedOn="{StaticResource MaterialDesignListBox}">
348+
<Style x:Key="MaterialDesignCardsListBox" TargetType="{x:Type ListBox}" BasedOn="{StaticResource MaterialDesignListBox}">
348349
<Setter Property="ItemContainerStyle" Value="{StaticResource MaterialDesignCardsListBoxItem}"/>
349350
</Style>
350351

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Menu.xaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@
7676
<Setter Property="Template">
7777
<Setter.Value>
7878
<ControlTemplate TargetType="{x:Type MenuItem}">
79+
<ControlTemplate.Resources>
80+
<Style TargetType="{x:Type wpf:PackIcon}" >
81+
<Setter Property="Width" Value="16" />
82+
<Setter Property="Height" Value="16" />
83+
</Style>
84+
</ControlTemplate.Resources>
7985
<Grid ClipToBounds="True">
8086
<Border x:Name="templateRoot"
8187
BorderBrush="{TemplateBinding BorderBrush}"

0 commit comments

Comments
 (0)