Skip to content

Commit ff6abc6

Browse files
committed
improve demo
1 parent ac7d6a8 commit ff6abc6

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

MainDemo.Wpf/TextFields.xaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,5 +238,17 @@
238238
</Binding>
239239
</TextBox.Text>
240240
</TextBox>
241+
<CheckBox Grid.Row="9" Grid.Column="4"
242+
x:Name="DisplaySelectedItemCheckBox"
243+
Margin="0 8 0 0">Display Selected Item In Drop Down</CheckBox>
244+
<ComboBox Grid.Row="10" Grid.Column="4"
245+
materialDesign:ComboBoxAssist.ShowSelectedItem="{Binding ElementName=DisplaySelectedItemCheckBox, Path=IsChecked}"
246+
Margin="0 8 0 8" HorizontalAlignment="Left">
247+
<ComboBoxItem IsSelected="True">Apple</ComboBoxItem>
248+
<ComboBoxItem>Banana</ComboBoxItem>
249+
<ComboBoxItem>Pear</ComboBoxItem>
250+
<ComboBoxItem>Orange</ComboBoxItem>
251+
</ComboBox>
252+
241253
</Grid>
242254
</UserControl>

MaterialDesignThemes.Wpf/ComboBoxAssist.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ public static class ComboBoxAssist
1111
{
1212
#region ShowSelectedItem
1313

14+
/// <summary>
15+
/// By default the selected item his hidden from the drop down list, as per Material Design specifications.
16+
/// To revert to a more classic Windows desktop behaviour, and show the currently selected item again in the drop
17+
/// down, set this attached propety to true.
18+
/// </summary>
1419
public static readonly DependencyProperty ShowSelectedItemProperty = DependencyProperty.RegisterAttached(
1520
"ShowSelectedItem",
1621
typeof (bool),

0 commit comments

Comments
 (0)