EnumerationComboBox ClassDW.WPFToolkit Documentation
Represents a ComboBox which takes an enumeration value and shows all possible states inside the dropdown menu for let choosing a value.
Inheritance Hierarchy

SystemObject
  System.Windows.ThreadingDispatcherObject
    System.WindowsDependencyObject
      System.Windows.MediaVisual
        System.WindowsUIElement
          System.WindowsFrameworkElement
            System.Windows.ControlsControl
              System.Windows.ControlsItemsControl
                System.Windows.Controls.PrimitivesSelector
                  System.Windows.ControlsComboBox
                    DW.WPFToolkit.ControlsEnumerationComboBox

Namespace: DW.WPFToolkit.Controls
Assembly: DW.WPFToolkit (in DW.WPFToolkit.dll) Version: 5.6.0.0
Syntax

C#
public class EnumerationComboBox : ComboBox

The EnumerationComboBox type exposes the following members.

Constructors

  NameDescription
Public methodEnumerationComboBox
Initializes a new instance of the EnumerationComboBox class.
Top
Methods

  NameDescription
Protected methodGetContainerForItemOverride
Generates a new child item container to hold in the EnumerationComboBox.
(Overrides ComboBoxGetContainerForItemOverride.)
Protected methodIsItemItsOwnContainerOverride
Checks if the item is already the correct item container. If not the GetContainerForItemOverride will be used to generate the right container.
(Overrides ComboBoxIsItemItsOwnContainerOverride(Object).)
Top
Fields

  NameDescription
Public fieldStatic memberDisplayKindProperty
Identifies the DisplayKind dependency property.
Public fieldStatic memberEnumTypeProperty
Identifies the EnumType dependency property.
Public fieldStatic memberItemConverterProperty
Identifies the ItemConverter dependency property.
Top
Properties

  NameDescription
Public propertyDisplayKind
Gets or sets the way hot to display the items in the drop down or in the selection box itself.
Public propertyEnumType
Gets or sets the type of the enum which named can be selected from.
Public propertyItemConverter
Gets or sets the converter to use when Custom is set as the DisplayKind.
Top
Examples

In the example the data shown in C# is the base the UI is binding to. See the XAML tab for the control usages.
public enum Number
{
    [Description("The Number One")]
    One,

    [Description("The Number Two")]
    Two,

    [Description("The Number Three")]
    Three
}

public class MainViewModel : ObservableObject
{
    public MainViewModel()
    {
        Number = Number.One;
    }

    public Number Number
    {
        get { return _number; }
        set
        {
            _number = value;
            NotifyPropertyChanged("Number");
        }
    }
    private Number _number;
}
See Also

Reference