Class
EnumDataSource

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

Definition

Namespace:Telerik.Windows.Data

Assembly:Telerik.Windows.Data.dll

Syntax:

cs-api-definition
public class EnumDataSource : IEnumerable, INotifyCollectionChanged

Inheritance: objectEnumDataSource

Implements: IEnumerableINotifyCollectionChanged

Constructors

EnumDataSource()

Initializes a new instance of the EnumDataSource class.

Declaration

cs-api-definition
public EnumDataSource()

Properties

EnumType

Gets or sets the type of the enum.

Declaration

cs-api-definition
public Type EnumType { get; set; }

Property Value

Type

The type of the enumeration.

Methods

FromType(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.

Declaration

cs-api-definition
public static IEnumerable<EnumMemberViewModel> FromType(Type enumType)

Parameters

enumType

Type

The enumeration type.

Returns

IEnumerable<EnumMemberViewModel>

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

FromType<TEnum>()

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.

Declaration

cs-api-definition
public static IEnumerable<EnumMemberViewModel> FromType<TEnum>() where TEnum : struct

Returns

IEnumerable<EnumMemberViewModel>

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

GetEnumerator()

Returns an enumerator that iterates through a collection.

Declaration

cs-api-definition
public IEnumerator GetEnumerator()

Returns

IEnumerator

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

Implements IEnumerable.GetEnumerator()

Events

CollectionChanged

Occurs when the collection changes.

Declaration

cs-api-definition
public event NotifyCollectionChangedEventHandler CollectionChanged

Event Value

NotifyCollectionChangedEventHandler

Implements INotifyCollectionChanged.CollectionChanged