Skip to content

ComboBox

Alex-451 edited this page Oct 9, 2022 · 1 revision

The ComboBox control presents users with a list of options. The list is shown and hidden as the control expands and collapses. In its default state, the list is collapsed, displaying only one choice.

Changing the color of the underline

The color of the underline can be changed by applying the TextFieldAssist.UnderlineBrush brush.

<ComboBox Style="{DynamicResource MaterialDesignComboBox}" materialDesign:TextFieldAssist.UnderlineBrush="Chocolate" >
    <ComboBoxItem IsSelected="True">Item 1</ComboBoxItem>
</ComboBox>

2022-10-09 22_11_22-Window

Styles

The Material Design In XAML Toolkit provides two styles:

  • MaterialDesignComboBox
  • MaterialDesignFloatingHintComboBox

MaterialDesignComboBox

The default ComboBox in the Material Design.

<ComboBox Style="{DynamicResource MaterialDesignComboBox}">
    <ComboBoxItem IsSelected="True">Item 1</ComboBoxItem>
</ComboBox>

2022-10-09 22_03_39-Window

MaterialDesignFloatingHintComboBox

Adds a customizable hint above the item preview.

<ComboBox Style="{DynamicResource MaterialDesignFloatingHintComboBox}" materialDesign:HintAssist.Hint="Hint text">
    <ComboBoxItem IsSelected="True">Item 1</ComboBoxItem>
</ComboBox>

2022-10-09 22_06_00-Window

Changing the color of the Hint

The color of the hint can be changed by applying the HintAssist.Foreground brush.

<ComboBox Style="{DynamicResource MaterialDesignFloatingHintComboBox}" materialDesign:HintAssist.Foreground="DeepPink" materialDesign:HintAssist.Hint="Hint text">
    <ComboBoxItem IsSelected="True">Item 1</ComboBoxItem>
</ComboBox>

2022-10-09 22_16_21-Window

Clone this wiki locally