In This Article

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
Derived:
ByteEditBox Int16EditBox Int32EditBox Int64EditBox FloatingPointNumberPartEditBoxBase<T>

Constructors

NumberPartEditBoxBase()

Initializes an instance of the class.

protected NumberPartEditBoxBase()

Properties

CalculatorPopupPickerStyle

The popup picker Style that uses a Calculator control.

public Style? CalculatorPopupPickerStyle { get; set; }

Property Value

Style

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.

public string ResolvedFormat { get; }

Property Value

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

IList<IPart>:

The parts that were generated.

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:

true if 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

Extension Methods