File tree Expand file tree Collapse file tree 3 files changed +37
-0
lines changed Expand file tree Collapse file tree 3 files changed +37
-0
lines changed Original file line number Diff line number Diff line change
1
+ using System ;
2
+ using System . Collections . Generic ;
3
+ using System . Linq ;
4
+ using System . Text ;
5
+ using System . Threading . Tasks ;
6
+ using System . Windows ;
7
+
8
+ namespace MaterialDesignThemes . Wpf
9
+ {
10
+ public static class ComboBoxAssist
11
+ {
12
+ #region ShowSelectedItem
13
+
14
+ public static readonly DependencyProperty ShowSelectedItemProperty = DependencyProperty . RegisterAttached (
15
+ "ShowSelectedItem" ,
16
+ typeof ( bool ) ,
17
+ typeof ( ComboBoxAssist ) ,
18
+ new FrameworkPropertyMetadata ( false ,
19
+ FrameworkPropertyMetadataOptions . AffectsRender | FrameworkPropertyMetadataOptions . Inherits ) ) ;
20
+
21
+ public static bool GetShowSelectedItem ( DependencyObject element , object value )
22
+ {
23
+ return ( bool ) element . GetValue ( ShowSelectedItemProperty ) ;
24
+ }
25
+
26
+ public static void SetShowSelectedItem ( DependencyObject element , object value )
27
+ {
28
+ element . SetValue ( ShowSelectedItemProperty , value ) ;
29
+ }
30
+
31
+ #endregion
32
+ }
33
+ }
Original file line number Diff line number Diff line change 238
238
<Compile Include =" ClockItemButton.cs" />
239
239
<Compile Include =" ColorZone.cs" />
240
240
<Compile Include =" ColorZoneAssist.cs" />
241
+ <Compile Include =" ComboBoxAssist.cs" />
241
242
<Compile Include =" ComboBoxPopup.cs" />
242
243
<Compile Include =" Converters\BooleanToVisibilityConverter.cs" />
243
244
<Compile Include =" Converters\BrushRoundConverter.cs" />
Original file line number Diff line number Diff line change 554
554
</Trigger >
555
555
<Trigger Property =" IsEditable" Value =" true" >
556
556
<Setter Property =" IsTabStop" Value =" false" />
557
+ <Setter Property =" wpf:ComboBoxAssist.ShowSelectedItem" Value =" True" />
558
+ </Trigger >
559
+ <Trigger Property =" wpf:ComboBoxAssist.ShowSelectedItem" Value =" True" >
557
560
<Setter Property =" ItemContainerStyle" Value =" {StaticResource MaterialDesignComboBoxItemStyle}" />
558
561
</Trigger >
559
562
</Style .Triggers>
You can’t perform that action at this time.
0 commit comments