New to Telerik UI for WPFStart a free 30-day trial

Provides a collection of view models suitable for combo-box binding.

Definition

Namespace:Telerik.Windows.Data

Assembly:Telerik.Windows.Data.dll

Syntax:

C#
public class EnumDataSource : IEnumerable, INotifyCollectionChanged

Inheritance: objectEnumDataSource

Implements: IEnumerableINotifyCollectionChanged

Constructors

Initializes a new instance of the EnumDataSource class.

C#
public EnumDataSource()

Properties

Gets or sets the type of the enum.

C#
public Type EnumType { get; set; }
Property Value:

The type of the enumeration.

Methods

Returns a collection of EnumMemberViewModel's based on the supplied enumeration type. You can use this method's return value as the ItemsSource of a combo-box.

C#
public static IEnumerable<EnumMemberViewModel> FromType(Type enumType)
Parameters:enumTypeType

The enumeration type.

Returns:

IEnumerable<EnumMemberViewModel>

A collection of EnumMemberViewModel's based on the supplied enumeration type.

Returns a collection of EnumMemberViewModel's based on the supplied enumeration type. You can use this method's return value as the ItemsSource of a combo-box.

C#
public static IEnumerable<EnumMemberViewModel> FromType<TEnum>() where TEnum : struct
Returns:

IEnumerable<EnumMemberViewModel>

A collection of EnumMemberViewModel's based on the supplied enumeration type.

Returns an enumerator that iterates through a collection.

C#
public IEnumerator GetEnumerator()
Returns:

IEnumerator

An IEnumerator object that can be used to iterate through the collection.

Implements: IEnumerable.GetEnumerator()

Events

Occurs when the collection changes.

C#
public event NotifyCollectionChangedEventHandler CollectionChanged

Implements: INotifyCollectionChanged.CollectionChanged