Skip to content

Commit 62e4d60

Browse files
committed
2 parents 1f7d076 + 7725a51 commit 62e4d60

File tree

5 files changed

+260
-50
lines changed

5 files changed

+260
-50
lines changed

.github/ISSUE_TEMPLATE

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
# This is a place for issues. Questions are better asked in the Gitter chat room.
44

5-
# Seriously consider creating and linking to a test repo which takes absolutely minimal setup to illustrate how reproduce the problem. My time is limited and and .Zip files, code snippets and partial examples are often a code snippet. GitHub also provides great communication and code review tools which can be utilised.
5+
# Seriously consider creating and linking to a test repo which takes absolutely minimal setup to illustrate how reproduce the problem.
6+
7+
My time is limited and .Zip files, code snippets and partial examples are often a time sink. GitHub also provides great communication and code review tools which can be utilised.
68

79
# HOW TO POST A GOOD SAMPLE. Follow these guidelines and I will most likely look at the issue sooner:
810

MainDemo.Wpf/TextFields.xaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@
6262
<RowDefinition Height="Auto" />
6363
<RowDefinition Height="Auto" />
6464
<RowDefinition Height="Auto" />
65+
<RowDefinition Height="Auto" />
66+
<RowDefinition Height="Auto" />
6567
</Grid.RowDefinitions>
6668
<TextBlock Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Style="{StaticResource MaterialDesignHeadlineTextBlock}">Common Fields</TextBlock>
6769
<materialDesign:PackIcon Grid.Row="1" Grid.Column="0" Kind="Account" Foreground="{Binding ElementName=NameTextBox, Path=BorderBrush}" />
@@ -262,6 +264,7 @@
262264
</TextBox>
263265
<CheckBox Grid.Row="9" Grid.Column="4"
264266
x:Name="DisplaySelectedItemCheckBox"
267+
IsThreeState="False"
265268
Margin="0 8 0 0">Display Selected Item In Drop Down</CheckBox>
266269
<ComboBox Grid.Row="10" Grid.Column="4"
267270
materialDesign:ComboBoxAssist.ShowSelectedItem="{Binding ElementName=DisplaySelectedItemCheckBox, Path=IsChecked}"
@@ -271,6 +274,18 @@
271274
<ComboBoxItem>Pear</ComboBoxItem>
272275
<ComboBoxItem>Orange</ComboBoxItem>
273276
</ComboBox>
277+
<CheckBox Grid.Row="11" Grid.Column="4"
278+
x:Name="ClassicModeCheckBox"
279+
IsThreeState="False" IsChecked="True"
280+
Margin="0 8 0 0">Use classic mode</CheckBox>
281+
<ComboBox Grid.Row="12" Grid.Column="4"
282+
materialDesign:ComboBoxAssist.ClassicMode="{Binding ElementName=ClassicModeCheckBox, Path=IsChecked}"
283+
Margin="0 8 0 8" HorizontalAlignment="Left">
284+
<ComboBoxItem IsSelected="True">Apple</ComboBoxItem>
285+
<ComboBoxItem>Banana</ComboBoxItem>
286+
<ComboBoxItem>Pear</ComboBoxItem>
287+
<ComboBoxItem>Orange</ComboBoxItem>
288+
</ComboBox>
274289

275290
</Grid>
276291
</UserControl>

MaterialDesignThemes.Wpf/ComboBoxAssist.cs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,27 @@ namespace MaterialDesignThemes.Wpf
1111
public static class ComboBoxAssist
1212
{
1313
/// <summary>
14-
/// By default the selected item his hidden from the drop down list, as per Material Design specifications.
14+
/// By default ComboBox uses the wrapper popup. Popup can be switched to classic Windows desktop view by means of this attached property.
15+
/// </summary>
16+
public static readonly DependencyProperty ClassicModeProperty = DependencyProperty.RegisterAttached(
17+
"ClassicMode",
18+
typeof (bool),
19+
typeof (ComboBoxAssist),
20+
new FrameworkPropertyMetadata(false,
21+
FrameworkPropertyMetadataOptions.AffectsRender | FrameworkPropertyMetadataOptions.Inherits));
22+
23+
public static bool GetClassicMode(DependencyObject element, object value)
24+
{
25+
return (bool)element.GetValue(ClassicModeProperty);
26+
}
27+
28+
public static void SetClassicMode(DependencyObject element, object value)
29+
{
30+
element.SetValue(ClassicModeProperty, value);
31+
}
32+
33+
/// <summary>
34+
/// By default the selected item is hidden from the drop down list, as per Material Design specifications.
1535
/// To revert to a more classic Windows desktop behaviour, and show the currently selected item again in the drop
1636
/// down, set this attached propety to true.
1737
/// </summary>

0 commit comments

Comments
 (0)