NumberPartEditBoxBase<T> Class
Represents the abstract base class for a part-based edit box for numeric values.
public abstract class NumberPartEditBoxBase<T> : PartEditBoxBase<T?> where T : struct, INumber<T>, IMinMaxValue<T>
- Type Parameters:
-
T-The numeric type to be edited.
- Inheritance:
- object Visual UIElement FrameworkElement Control PartEditBoxBase<T?> object
Constructors
NumberPartEditBoxBase()
Initializes an instance of the class.
protected NumberPartEditBoxBase()
Properties
CalculatorPopupPickerStyle
The popup picker Style that uses a Calculator control.
DefaultValue
The value to set when incrementing/decrementing from a null value.
public T DefaultValue { get; set; }
Property Value
- T:
The default value is
0.
Format
The number format string.
public string Format { get; set; }
Property Value
- string:
The default value is
"D".
Remarks
This value can be defined as a numeric (e.g., "D") or composite (e.g., "{0:D}") format string.
LargeChange
The large change value.
public T LargeChange { get; set; }
Property Value
- T:
The default value is
5.
Maximum
The highest possible value.
public T Maximum { get; set; }
Property Value
- T
Minimum
The lowest possible value.
public T Minimum { get; set; }
Property Value
- T
ResolvedFormat
The resolved number format string.
SmallChange
The small change value.
public T SmallChange { get; set; }
Property Value
- T:
The default value is
1.
Methods
CoerceValidValue(T?)
Coerces the value to be within range.
protected override T? CoerceValidValue(T? value)
| Parameter | Type | Description |
|---|---|---|
| value | T? | The value to coerce. |
Returns
- T?:
The coerced value.
ConvertToString(T?)
Converts the specified value to a string representation.
protected override string ConvertToString(T? valueToConvert)
| Parameter | Type | Description |
|---|---|---|
| valueToConvert | T? | The value. |
Returns
- string:
The string representation of the specified value.
CreateIncrementalChangeRequest(IncrementalChangeRequestKind)
Creates an incremental change (spin) request.
protected override IncrementalChangeRequest<T?> CreateIncrementalChangeRequest(IncrementalChangeRequestKind kind)
| Parameter | Type | Description |
|---|---|---|
| kind | IncrementalChangeRequestKind | The kind of request. |
Returns
- IncrementalChangeRequest<T?>:
The incremental change (spin) request that was created.
GenerateParts()
Generates the parts for the edit box.
protected override IList<IPart> GenerateParts()
Returns
IsValidValue(T?)
Tests whether the specified value is valid.
protected override bool IsValidValue(T? value)
| Parameter | Type | Description |
|---|---|---|
| value | T? | The value to examine. |
Returns
- bool:
trueif the value is valid; otherwise,false.
ResetValue()
Resets the value to a default value.
protected override void ResetValue()
Fields
CalculatorPopupPickerStyleProperty
Defines the CalculatorPopupPickerStyle property.
public static readonly DependencyProperty CalculatorPopupPickerStyleProperty
DefaultValueProperty
Defines the DefaultValue property.
public static readonly DependencyProperty DefaultValueProperty
FormatProperty
Defines the Format property.
public static readonly DependencyProperty FormatProperty
LargeChangeProperty
Defines the LargeChange property.
public static readonly DependencyProperty LargeChangeProperty
MaximumProperty
Defines the Maximum property.
public static readonly DependencyProperty MaximumProperty
MinimumProperty
Defines the Minimum property.
public static readonly DependencyProperty MinimumProperty
ResolvedFormatProperty
Defines the ResolvedFormat property.
public static readonly DependencyProperty ResolvedFormatProperty
SmallChangeProperty
Defines the SmallChange property.
public static readonly DependencyProperty SmallChangeProperty
Inherited Members
- PartEditBoxBase<T?>.ActivePartIndexProperty
- PartEditBoxBase<T?>.CommitTriggersProperty
- PartEditBoxBase<T?>.HasPopupProperty
- PartEditBoxBase<T?>.InlinesProperty
- PartEditBoxBase<T?>.InputScopeNameValueProperty
- PartEditBoxBase<T?>.IntermediateValueProperty
- PartEditBoxBase<T?>.IsArrowKeyPartNavigationEnabledProperty
- PartEditBoxBase<T?>.IsEditableProperty
- PartEditBoxBase<T?>.IsInputFilteringEnabledProperty
- PartEditBoxBase<T?>.IsNonDefaultUsageContextProperty
- PartEditBoxBase<T?>.IsNullAllowedProperty
- PartEditBoxBase<T?>.IsPopupButtonVisibleProperty
- PartEditBoxBase<T?>.IsPopupOpenProperty
- PartEditBoxBase<T?>.IsReadOnlyProperty
- PartEditBoxBase<T?>.IsSpinnerVisibleProperty
- PartEditBoxBase<T?>.IsUndoEnabledProperty
- PartEditBoxBase<T?>.PlaceholderTextProperty
- PartEditBoxBase<T?>.PopupBackgroundProperty
- PartEditBoxBase<T?>.PopupBorderBrushProperty
- PartEditBoxBase<T?>.PopupPickerStyleProperty
- PartEditBoxBase<T?>.SpinnerVisibilityProperty
- PartEditBoxBase<T?>.SpinWrappingProperty
- PartEditBoxBase<T?>.TextAlignmentProperty
- PartEditBoxBase<T?>.UsageContextProperty
- PartEditBoxBase<T?>.ValueProperty
- PartEditBoxBase<T?>.Commit()
- PartEditBoxBase<T?>.Commit(bool)
- PartEditBoxBase<T?>.InvalidateParts()
- PartEditBoxBase<T?>.IsTextInputAllowed(string)
- PartEditBoxBase<T?>.OnApplyTemplate()
- PartEditBoxBase<T?>.OnCreateAutomationPeer()
- PartEditBoxBase<T?>.OnGotFocus(RoutedEventArgs)
- PartEditBoxBase<T?>.OnIntermediateValueChanged(T?, T?)
- PartEditBoxBase<T?>.OnIsKeyboardFocusWithinChanged(DependencyPropertyChangedEventArgs)
- PartEditBoxBase<T?>.OnIsNullAllowedChanged(bool, bool)
- PartEditBoxBase<T?>.OnKeyDown(KeyEventArgs)
- PartEditBoxBase<T?>.OnLostFocus(RoutedEventArgs)
- PartEditBoxBase<T?>.OnLostMouseCapture(MouseEventArgs)
- PartEditBoxBase<T?>.OnMouseLeftButtonDown(MouseButtonEventArgs)
- PartEditBoxBase<T?>.OnPopupOpened()
- PartEditBoxBase<T?>.OnPreviewMouseUp(MouseButtonEventArgs)
- PartEditBoxBase<T?>.OnPreviewTextInput(TextCompositionEventArgs)
- PartEditBoxBase<T?>.OnValueChanged(T?, T?)
- PartEditBoxBase<T?>.ProcessTextInput(string)
- PartEditBoxBase<T?>.SelectAll()
- PartEditBoxBase<T?>.TryConvertFromString(string, bool, out T?)
- PartEditBoxBase<T?>.UpdateIntermediateValueAndTextFromValue()
- PartEditBoxBase<T?>.ActivePartIndex
- PartEditBoxBase<T?>.CommitTriggers
- PartEditBoxBase<T?>.CurrentSelectionLength
- PartEditBoxBase<T?>.CurrentSelectionStartOffset
- PartEditBoxBase<T?>.CurrentText
- PartEditBoxBase<T?>.HasPopupButtonWhenReadOnly
- PartEditBoxBase<T?>.HasPopup
- PartEditBoxBase<T?>.Inlines
- PartEditBoxBase<T?>.InputScopeNameValue
- PartEditBoxBase<T?>.IntermediateValue
- PartEditBoxBase<T?>.IsArrowKeyPartNavigationEnabled
- PartEditBoxBase<T?>.IsEditable
- PartEditBoxBase<T?>.IsInputFilteringEnabled
- PartEditBoxBase<T?>.IsNonDefaultUsageContext
- PartEditBoxBase<T?>.IsNullAllowed
- PartEditBoxBase<T?>.IsPopupButtonVisible
- PartEditBoxBase<T?>.IsPopupOpen
- PartEditBoxBase<T?>.IsReadOnly
- PartEditBoxBase<T?>.IsSpinnerVisible
- PartEditBoxBase<T?>.IsUndoEnabled
- PartEditBoxBase<T?>.Parts
- PartEditBoxBase<T?>.PlaceholderText
- PartEditBoxBase<T?>.PopupBackground
- PartEditBoxBase<T?>.PopupBorderBrush
- PartEditBoxBase<T?>.PopupPickerStyle
- PartEditBoxBase<T?>.ResetValueCommand
- PartEditBoxBase<T?>.SmallDecrementValueCommand
- PartEditBoxBase<T?>.SmallIncrementValueCommand
- PartEditBoxBase<T?>.SpinnerVisibility
- PartEditBoxBase<T?>.SpinWrapping
- PartEditBoxBase<T?>.TextAlignment
- PartEditBoxBase<T?>.UsageContext
- PartEditBoxBase<T?>.Value
- PartEditBoxBase<T?>.ValueChanged