In This Article

SizeEditBox Class

Represents a Size edit box.

public class SizeEditBox : PartEditBoxBase<Size?>
Inheritance:
object Visual UIElement FrameworkElement Control PartEditBoxBase<Size?> object

Constructors

SizeEditBox()

Initializes an instance of the class.

public SizeEditBox()

Properties

DefaultValue

The value to set when incrementing/decrementing from a null value.

public Size DefaultValue { get; set; }

Property Value

Size:

The default value is 0.

Format

The number format string.

public string Format { get; set; }

Property Value

string:

The default value is "G".

Remarks

This value can be defined as a numeric (e.g., "G") or composite (e.g., "{0:G}") format string.

IsNaNAllowed

Indicates whether NaN is accepted as a component value.

public bool IsNaNAllowed { get; set; }

Property Value

bool:

true if NaN is accepted as a component value; otherwise, false. The default value is false.

IsNegativeInfinityAllowed

Indicates whether NegativeInfinity is accepted as a component value.

public bool IsNegativeInfinityAllowed { get; set; }

Property Value

bool:

true if NegativeInfinity is accepted as a component value; otherwise, false. The default value is false.

IsPositiveInfinityAllowed

Indicates whether PositiveInfinity is accepted as a component value.

public bool IsPositiveInfinityAllowed { get; set; }

Property Value

bool:

true if PositiveInfinity is accepted as a component value; otherwise, false. The default value is false.

LargeChange

The large change value.

public Size LargeChange { get; set; }

Property Value

Size:

The default value is 5.0.

Maximum

The highest possible value.

public Size Maximum { get; set; }

Property Value

Size

Minimum

The lowest possible value.

public Size Minimum { get; set; }

Property Value

Size

ResolvedFormat

The resolved number format string.

public string ResolvedFormat { get; }

Property Value

string

RoundingDecimalPlace

The rounding decimal place, which is a value between 0 and 15.

public int? RoundingDecimalPlace { get; set; }

Property Value

int?:

Pass a null value to disable rounding. The default value is 8.

SmallChange

The small change value.

public Size SmallChange { get; set; }

Property Value

Size:

The default value is 1.0.

Methods

CoerceValidValue(Size?)

Coerces the value to be within range.

protected override Size? CoerceValidValue(Size? value)
Parameter Type Description
value Size?

The value to coerce.

Returns

Size?:

The coerced value.

ConvertToString(Size?)

Converts the specified value to a string representation.

protected override string ConvertToString(Size? valueToConvert)
Parameter Type Description
valueToConvert Size?

The value.

Returns

string:

The string representation of the specified value.

CreateIncrementalChangeRequest(IncrementalChangeRequestKind)

Creates an incremental change (spin) request.

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

The kind of request.

Returns

IncrementalChangeRequest<Size?>:

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(Size?)

Tests whether the specified value is valid.

protected override bool IsValidValue(Size? value)
Parameter Type Description
value Size?

The value to examine.

Returns

bool:

true if the value is valid; otherwise, false.

ProcessTextInput(string)

Processes typed text.

protected override bool ProcessTextInput(string text)
Parameter Type Description
text string

The typed text.

Returns

bool:

true if the typed text was handled and should not be allowed to be entered; otherwise, false.

ResetValue()

Resets the value to a default value.

protected override void ResetValue()

TryConvertFromString(string?, bool, out Size??)

Tries to convert the specified text to a value.

protected override bool TryConvertFromString(string? textToConvert, bool canCoerce, out Size?? value)
Parameter Type Description
textToConvert string

The text.

canCoerce bool

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

value Size?

Returns the value for the specified text.

Returns

bool:

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

Fields

DefaultValueProperty

Defines the DefaultValue property.

public static readonly DependencyProperty DefaultValueProperty

FormatProperty

Defines the Format property.

public static readonly DependencyProperty FormatProperty

IsNaNAllowedProperty

Defines the IsNaNAllowed property.

public static readonly DependencyProperty IsNaNAllowedProperty

IsNegativeInfinityAllowedProperty

Defines the IsNegativeInfinityAllowed property.

public static readonly DependencyProperty IsNegativeInfinityAllowedProperty

IsPositiveInfinityAllowedProperty

Defines the IsPositiveInfinityAllowed property.

public static readonly DependencyProperty IsPositiveInfinityAllowedProperty

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

RoundingDecimalPlaceProperty

Defines the RoundingDecimalPlace property.

public static readonly DependencyProperty RoundingDecimalPlaceProperty

SmallChangeProperty

Defines the SmallChange property.

public static readonly DependencyProperty SmallChangeProperty

Inherited Members

Extension Methods