In This Article

EnumEditBox Class

Represents an Enum edit box.

public class EnumEditBox : PartEditBoxBase<object>, DUCE.IResource, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IHaveResources, IQueryAmbient
Inheritance:
Object DispatcherObject DependencyObject Visual UIElement FrameworkElement Control PartEditBoxBase<Object> Object

Constructors

EnumEditBox()

Initializes an instance of the EnumEditBox class.

public EnumEditBox()

Properties

EnumSortComparer

Gets or sets the IComparer<T> used to sort the enumeration values.

public IComparer<Enum> EnumSortComparer { get; set; }

Property Value

IComparer<Enum>:

The IComparer<T> used to sort the enumeration values; otherwise null to indicate no sorting, which will use the order the enumeration values are defined.

EnumType

Gets or sets the enumeration type.

public Type EnumType { get; set; }

Property Value

Type:

The enumeration type.

HasPopupButtonWhenReadOnly

Gets whether the control should display the popup button when the control is read-only.

protected override bool HasPopupButtonWhenReadOnly { get; }

Property Value

Boolean:

true if the control should display the popup button when the control is read-only; otherwise, false.

UseDisplayAttributes

Gets or sets a value indicating whether enumeration values should be displayed using an associated DisplayAttribute, if any.

public bool UseDisplayAttributes { get; set; }

Property Value

Boolean:

true if enumeration values should be displayed using an associated DisplayAttribute, if any; otherwise false. The default value is false.

Methods

ConvertToString(Object)

Converts the specified value to a string representation.

protected override string ConvertToString(object valueToConvert)
Parameter Type Description
valueToConvert Object

The value.

Returns

String:

The string representation of the specified value.

CreateIncrementalChangeRequest(IncrementalChangeRequestKind)

Creates an incremental change (spin) request.

protected override IncrementalChangeRequest<object> CreateIncrementalChangeRequest(IncrementalChangeRequestKind kind)
Parameter Type Description
kind IncrementalChangeRequestKind

The kind of request.

Returns

IncrementalChangeRequest<Object>:

The incremental change (spin) request that was created.

GenerateParts()

Generates the parts for the edit box.

protected override IList<IPart> GenerateParts()

Returns

IList<IPart>:

The parts that were generated.

IsValidValue(Object)

Returns whether the specified value is valid.

protected override bool IsValidValue(object value)
Parameter Type Description
value Object

The value to examine.

Returns

Boolean:

true if the value is valid; otherwise, false.

RaiseValueChangedEvent()

Raises the ValueChanged event.

protected override void RaiseValueChangedEvent()

ResetValue()

Resets the value to a default value.

protected override void ResetValue()

TryConvertFromString(String, Boolean, out Object)

Tries to convert the specified text to a value.

protected override bool TryConvertFromString(string textToConvert, bool canCoerce, out object value)
Parameter Type Description
textToConvert String

The text.

canCoerce Boolean

Whether the returned value should be coerced to fall within the allowed value range.

value Object

Returns the value for the specified text.

Returns

Boolean:

true if the text was converted to a value successfully; otherwise, false.

Events

ValueChanged

Occurs after the Value property value changes.

public event EventHandler ValueChanged

Event Type

EventHandler

Fields

EnumSortComparerProperty

Identifies the EnumSortComparer dependency property. This field is read-only.

public static readonly DependencyProperty EnumSortComparerProperty

EnumTypeProperty

Identifies the EnumType dependency property. This field is read-only.

public static readonly DependencyProperty EnumTypeProperty

UseDisplayAttributesProperty

Identifies the UseDisplayAttributes dependency property. This field is read-only.

public static readonly DependencyProperty UseDisplayAttributesProperty

Inherited Members

Extension Methods