EnumEditBox Class
Represents an Enum
edit box.
public class EnumEditBox : PartEditBoxBase<object>, DUCE.IResource, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IHaveResources, IQueryAmbient
- Inheritance:
- System.Object System.Windows.Threading.DispatcherObject System.Windows.DependencyObject System.Windows.Media.Visual System.Windows.UIElement System.Windows.FrameworkElement System.Windows.Controls.Control PartEditBoxBase<System.Object> Object
Constructors
EnumEditBox()
Initializes an instance of the EnumEditBox
class.
public EnumEditBox()
Properties
EnumSortComparer
Gets or sets the System.Collections.Generic.IComparer<T> used to sort the enumeration values.
public IComparer<Enum> EnumSortComparer { get; set; }
Property Value
- System.Collections.Generic.IComparer<System.Enum>:
The System.Collections.Generic.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
- System.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
- System.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
- System.Boolean:
true
if enumeration values should be displayed using an associatedDisplayAttribute
, if any; otherwisefalse
. The default value isfalse
.
Methods
ConvertToString(Object)
Converts the specified value to a string representation.
protected override string ConvertToString(object valueToConvert)
Parameter | Type | Description |
---|---|---|
valueToConvert | System.Object | The value. |
Returns
- System.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<System.Object>:
The incremental change (spin) request that was created.
GenerateParts()
Generates the parts for the edit box.
protected override IList<IPart> GenerateParts()
Returns
- System.Collections.Generic.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 | System.Object | The value to examine. |
Returns
- System.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 | System.String | The text. |
canCoerce | System.Boolean | Whether the returned value should be coerced to fall within the allowed value range. |
value | System.Object | Returns the value for the specified text. |
Returns
- System.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
- System.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
- PartEditBoxBase<Object>.ActivePartIndexProperty
- PartEditBoxBase<Object>.CommitTriggersProperty
- PartEditBoxBase<Object>.HasPopupProperty
- PartEditBoxBase<Object>.InlinesProperty
- PartEditBoxBase<Object>.InputScopeNameValueProperty
- PartEditBoxBase<Object>.IntermediateValueProperty
- PartEditBoxBase<Object>.IsArrowKeyPartNavigationEnabledProperty
- PartEditBoxBase<Object>.IsEditableProperty
- PartEditBoxBase<Object>.IsNullAllowedProperty
- PartEditBoxBase<Object>.IsPopupButtonVisibleProperty
- PartEditBoxBase<Object>.IsPopupOpenProperty
- PartEditBoxBase<Object>.IsReadOnlyProperty
- PartEditBoxBase<Object>.IsSpinnerVisibleProperty
- PartEditBoxBase<Object>.IsUndoEnabledProperty
- PartEditBoxBase<Object>.PlaceholderTextProperty
- PartEditBoxBase<Object>.PopupBackgroundProperty
- PartEditBoxBase<Object>.PopupBorderBrushProperty
- PartEditBoxBase<Object>.PopupPickerStyleProperty
- PartEditBoxBase<Object>.SpinWrappingProperty
- PartEditBoxBase<Object>.TextAlignmentProperty
- PartEditBoxBase<Object>.ValueProperty
- PartEditBoxBase<Object>.IsNonDefaultUsageContextProperty
- PartEditBoxBase<Object>.SpinnerVisibilityProperty
- PartEditBoxBase<Object>.UsageContextProperty
- PartEditBoxBase<Object>.CoerceValidValue(Object)
- PartEditBoxBase<Object>.Commit()
- PartEditBoxBase<Object>.Commit(Boolean)
- PartEditBoxBase<Object>.InvalidateParts()
- PartEditBoxBase<Object>.OnApplyTemplate()
- PartEditBoxBase<Object>.OnCreateAutomationPeer()
- PartEditBoxBase<Object>.OnGotFocus(RoutedEventArgs)
- PartEditBoxBase<Object>.OnIntermediateValueChanged(Object, Object)
- PartEditBoxBase<Object>.OnIsNullAllowedChanged(Boolean, Boolean)
- PartEditBoxBase<Object>.OnKeyDown(KeyEventArgs)
- PartEditBoxBase<Object>.OnLostFocus(RoutedEventArgs)
- PartEditBoxBase<Object>.OnPopupOpened()
- PartEditBoxBase<Object>.OnValueChanged(Object, Object)
- PartEditBoxBase<Object>.ProcessTextInput(String)
- PartEditBoxBase<Object>.SelectAll()
- PartEditBoxBase<Object>.UpdateIntermediateValueAndTextFromValue()
- PartEditBoxBase<Object>.OnIsKeyboardFocusWithinChanged(DependencyPropertyChangedEventArgs)
- PartEditBoxBase<Object>.OnLostMouseCapture(MouseEventArgs)
- PartEditBoxBase<Object>.OnMouseLeftButtonDown(MouseButtonEventArgs)
- PartEditBoxBase<Object>.OnPreviewMouseUp(MouseButtonEventArgs)
- PartEditBoxBase<Object>.OnPreviewTextInput(TextCompositionEventArgs)
- PartEditBoxBase<Object>.ActivePartIndex
- PartEditBoxBase<Object>.CommitTriggers
- PartEditBoxBase<Object>.CurrentSelectionLength
- PartEditBoxBase<Object>.CurrentSelectionStartOffset
- PartEditBoxBase<Object>.CurrentText
- PartEditBoxBase<Object>.HasPopup
- PartEditBoxBase<Object>.Inlines
- PartEditBoxBase<Object>.InputScopeNameValue
- PartEditBoxBase<Object>.IntermediateValue
- PartEditBoxBase<Object>.IsArrowKeyPartNavigationEnabled
- PartEditBoxBase<Object>.IsEditable
- PartEditBoxBase<Object>.IsNullAllowed
- PartEditBoxBase<Object>.IsPopupButtonVisible
- PartEditBoxBase<Object>.IsPopupOpen
- PartEditBoxBase<Object>.IsReadOnly
- PartEditBoxBase<Object>.IsSpinnerVisible
- PartEditBoxBase<Object>.IsUndoEnabled
- PartEditBoxBase<Object>.Parts
- PartEditBoxBase<Object>.PlaceholderText
- PartEditBoxBase<Object>.PopupBackground
- PartEditBoxBase<Object>.PopupBorderBrush
- PartEditBoxBase<Object>.PopupPickerStyle
- PartEditBoxBase<Object>.ResetValueCommand
- PartEditBoxBase<Object>.SmallDecrementValueCommand
- PartEditBoxBase<Object>.SmallIncrementValueCommand
- PartEditBoxBase<Object>.SpinWrapping
- PartEditBoxBase<Object>.TextAlignment
- PartEditBoxBase<Object>.Value
- PartEditBoxBase<Object>.IsNonDefaultUsageContext
- PartEditBoxBase<Object>.SpinnerVisibility
- PartEditBoxBase<Object>.UsageContext
- Object.ToString()
- Object.Equals(Object)
- Object.Equals(Object, Object)
- Object.ReferenceEquals(Object, Object)
- Object.GetHashCode()
- Object.GetType()
- Object.MemberwiseClone()
Extension Methods
- FrameworkElementExtensions.AnimateDoubleProperty(String, Double, Double, Double, Nullable<Double>, Nullable<Double>)
- FrameworkElementExtensions.BindToProperty(DependencyProperty, Object, String, BindingMode, IValueConverter, Object)
- FrameworkElementExtensions.BindToProperty(DependencyProperty, Object, DependencyProperty, BindingMode, IValueConverter, Object)
- FrameworkElementExtensions.GetCurrentSize()