EnumValuesExtension Class
XAML markup extension that provides all values of an enum type.
public sealed class EnumValuesExtension : MarkupExtensionExample
<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:wpf="clr-namespace:Meziantou.Framework.WPF;assembly=Meziantou.Framework.WPF"
xmlns:local="clr-namespace:Meziantou.Framework.WPF.EnumComboBox">
<ComboBox ItemsSource="{wpf:EnumValues {x:Type local:Week}}" />
</UserControl>- Inheritance
MarkupExtensionEnumValuesExtension
Constructors
| Name | Description |
|---|---|
| EnumValuesExtension() | Initializes a new instance of the EnumValuesExtension class. |
| EnumValuesExtension(Type) | Initializes a new instance of the EnumValuesExtension class with the specified enum type. |
EnumValuesExtension overloads
EnumValuesExtension()
EnumValuesExtension.csInitializes a new instance of the EnumValuesExtension class.
public EnumValuesExtension()EnumValuesExtension(Type)
EnumValuesExtension.csInitializes a new instance of the EnumValuesExtension class with the specified enum type.
public EnumValuesExtension(Type enumType)Parameters
enumTypeType- The enum type.
Properties
| Name | Description |
|---|---|
| EnumType | Gets or sets the enum type to get values from. |
EnumType
EnumValuesExtension.csMethods
| Name | Description |
|---|---|
| ProvideValue(IServiceProvider) | Returns the enum values. |
ProvideValue(IServiceProvider)
EnumValuesExtension.csReturns the enum values.
public override object ProvideValue(IServiceProvider serviceProvider)