Skip to content

Commit d5aca96

Browse files
committed
Merge branch 'ComboBoxHint' of https://github.com/EdonGashi/MaterialDesignInXamlToolkit into EdonGashi-ComboBoxHint
2 parents d238ea0 + e709e12 commit d5aca96

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

MaterialDesignThemes.Wpf/HintProxyFabric.ComboBox.cs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,21 @@ private sealed class ComboBoxHintProxy : IHintProxy
1616
private readonly ComboBox _comboBox;
1717
private readonly TextChangedEventHandler _comboBoxTextChangedEventHandler;
1818

19-
public object Content => _comboBox.IsEditable
20-
? _comboBox.Text
21-
: _comboBox.SelectedItem != null ? " " : null;
19+
public object Content
20+
{
21+
get
22+
{
23+
if (_comboBox.IsEditable)
24+
{
25+
return _comboBox.Text;
26+
}
27+
28+
ComboBoxItem comboBoxItem = _comboBox.SelectedItem as ComboBoxItem;
29+
return comboBoxItem != null
30+
? comboBoxItem.Content
31+
: _comboBox.SelectedItem;
32+
}
33+
}
2234

2335
public bool IsLoaded => _comboBox.IsLoaded;
2436
public bool IsVisible => _comboBox.IsVisible;

0 commit comments

Comments
 (0)