Skip to content

Commit 7d711c4

Browse files
authored
Combo box template (#2428)
* New combobox template * Cleaning up the ComboBoxPopup Obsoleted all of the dead templates * Setting popup direction to control CornerRadius * Marking old templates as obsolete
1 parent 75abfa1 commit 7d711c4

File tree

6 files changed

+269
-318
lines changed

6 files changed

+269
-318
lines changed

MainDemo.Wpf/ComboBoxes.xaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<Setter Property="Width" Value="96" />
3939
</Style>
4040
</StackPanel.Resources>
41-
41+
4242
<smtx:XamlDisplay UniqueKey="comboboxes_1" Margin="0">
4343

4444
<ComboBox materialDesign:HintAssist.Hint="OS">
@@ -47,7 +47,7 @@
4747
<ComboBoxItem Content="Linux"/>
4848
<ComboBoxItem Content="Windows"/>
4949
</ComboBox>
50-
</smtx:XamlDisplay>
50+
</smtx:XamlDisplay>
5151
<smtx:XamlDisplay UniqueKey="comboboxes_2">
5252
<ComboBox
5353
materialDesign:HintAssist.Hint="Search"
@@ -78,7 +78,7 @@
7878
materialDesign:TextFieldAssist.HasClearButton="True"
7979
materialDesign:TextFieldAssist.SuffixText="sw"
8080
materialDesign:TextFieldAssist.UnderlineBrush="{DynamicResource SecondaryHueMidBrush}"
81-
materialDesign:ColorZoneAssist.Mode="Inverted"
81+
materialDesign:ColorZoneAssist.Mode="SecondaryLight"
8282
materialDesign:HintAssist.Hint="OS"
8383
materialDesign:HintAssist.HelperText="Select one OS"
8484
MinWidth="128">

MainDemo.Wpf/FieldsLineUp.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,10 @@
199199
Grid.Column="3"
200200
Grid.Row="3"
201201
Style="{StaticResource MaterialDesignFilledComboBox}" />
202-
<TextBlock
202+
<ComboBox
203203
Grid.Column="3"
204204
Grid.Row="4"
205-
Style="{StaticResource NotAvailable}" />
205+
Style="{StaticResource MaterialDesignOutlinedComboBox}" />
206206

207207
<DatePicker
208208
Grid.Column="4"

MaterialDesignThemes.Wpf/ComboBoxAssist.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Windows;
1+
using System;
2+
using System.Windows;
23

34
namespace MaterialDesignThemes.Wpf
45
{
@@ -7,16 +8,19 @@ public static class ComboBoxAssist
78
/// <summary>
89
/// By default ComboBox uses the wrapper popup. Popup can be switched to classic Windows desktop view by means of this attached property.
910
/// </summary>
11+
[Obsolete("ClassicMode is now obsolete and has no affect.")]
1012
public static readonly DependencyProperty ClassicModeProperty = DependencyProperty.RegisterAttached(
1113
"ClassicMode",
1214
typeof(bool),
1315
typeof(ComboBoxAssist),
1416
new FrameworkPropertyMetadata(false,
1517
FrameworkPropertyMetadataOptions.AffectsRender | FrameworkPropertyMetadataOptions.Inherits));
1618

19+
[Obsolete("ClassicMode is now obsolete and has no affect.")]
1720
public static bool GetClassicMode(DependencyObject element)
1821
=> (bool)element.GetValue(ClassicModeProperty);
1922

23+
[Obsolete("ClassicMode is now obsolete and has no affect.")]
2024
public static void SetClassicMode(DependencyObject element, bool value)
2125
=> element.SetValue(ClassicModeProperty, value);
2226

0 commit comments

Comments
 (0)