Skip to content

Commit c38fbf1

Browse files
committed
Merge branch 'flat-toggle-listbox' of https://github.com/mgnslndh/MaterialDesignInXamlToolkit into mgnslndh-flat-toggle-listbox
2 parents eefd7b4 + 2a15dbf commit c38fbf1

File tree

2 files changed

+29
-2
lines changed

2 files changed

+29
-2
lines changed

MainDemo.Wpf/Buttons.xaml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,29 @@
303303
</ListBoxItem>
304304
</ListBox>
305305

306-
<ListBox Grid.Column="1" Grid.Row="1" Style="{StaticResource MaterialDesignToolToggleListBox}"
306+
<ListBox Grid.Column="1" Grid.Row="1" Style="{StaticResource MaterialDesignToolToggleFlatListBox}" SelectedIndex="0">
307+
<ListBox.ToolTip>
308+
<StackPanel>
309+
<TextBlock Text="MaterialDesignToolToggleFlatListBox" />
310+
<TextBlock Text="Exclusive selection" />
311+
<TextBlock Text="ListBoxAssist.IsToggle allows more natural toggle behaviour" />
312+
</StackPanel>
313+
</ListBox.ToolTip>
314+
<ListBoxItem>
315+
<materialDesign:PackIcon Kind="FormatAlignLeft"/>
316+
</ListBoxItem>
317+
<ListBoxItem>
318+
<materialDesign:PackIcon Kind="FormatAlignCenter"/>
319+
</ListBoxItem>
320+
<ListBoxItem>
321+
<materialDesign:PackIcon Kind="FormatAlignRight"/>
322+
</ListBoxItem>
323+
<ListBoxItem>
324+
<materialDesign:PackIcon Kind="FormatAlignJustify"/>
325+
</ListBoxItem>
326+
</ListBox>
327+
328+
<ListBox Grid.Column="1" Grid.Row="2" Style="{StaticResource MaterialDesignToolToggleListBox}"
307329
SelectionMode="Extended"
308330
Margin="0 8 0 0">
309331
<ListBox.ToolTip>

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.ListBox.xaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@
150150
<Setter Property="ScrollViewer.PanningMode" Value="Both"/>
151151
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
152152
<Setter Property="wpf:ListBoxAssist.IsToggle" Value="True" />
153+
<Setter Property="wpf:ShadowAssist.ShadowDepth" Value="Depth1" />
153154
<Setter Property="VerticalContentAlignment" Value="Center"/>
154155
<Setter Property="ItemContainerStyle" Value="{StaticResource MaterialDesignToolToggleListBoxItem}"/>
155156
<Setter Property="ItemsPanel">
@@ -174,7 +175,7 @@
174175
Background="{TemplateBinding Background}"
175176
SnapsToDevicePixels="true"
176177
Padding="{TemplateBinding Padding}">
177-
<wpf:Card wpf:ShadowAssist.ShadowDepth="Depth1" HorizontalAlignment="Left">
178+
<wpf:Card wpf:ShadowAssist.ShadowDepth="{TemplateBinding wpf:ShadowAssist.ShadowDepth}" HorizontalAlignment="Left">
178179
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
179180
</wpf:Card>
180181
</Border>
@@ -192,6 +193,10 @@
192193
</Setter>
193194
</Style>
194195

196+
<Style x:Key="MaterialDesignToolToggleFlatListBox" TargetType="{x:Type ListBox}" BasedOn="{StaticResource MaterialDesignToolToggleListBox}">
197+
<Setter Property="wpf:ShadowAssist.ShadowDepth" Value="Depth0" />
198+
</Style>
199+
195200
<Style x:Key="MaterialDesignListBoxItem" TargetType="{x:Type ListBoxItem}">
196201
<Setter Property="Background" Value="Transparent"/>
197202
<Setter Property="BorderThickness" Value="0"/>

0 commit comments

Comments
 (0)