In This Article

TimeSpanEditBox Class

Represents a timespan edit box.

public class TimeSpanEditBox : PartEditBoxBase<TimeSpan?>
Inheritance:
object Visual UIElement FrameworkElement Control PartEditBoxBase<TimeSpan?> object

Constructors

TimeSpanEditBox()

Initializes an instance of the class.

public TimeSpanEditBox()

Properties

DefaultValue

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

public TimeSpan DefaultValue { get; set; }

Property Value

TimeSpan:

The default value is 0.

Format

The timespan format string.

public string Format { get; set; }

Property Value

string:

The default value is "g".

HasPopupButtonWhenReadOnly

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

protected override bool HasPopupButtonWhenReadOnly { get; }

Property Value

bool:

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

LargeChange

The large change value.

public TimeSpan LargeChange { get; set; }

Property Value

TimeSpan:

The default value is 7.3:5:5:050.

Maximum

The highest possible value.

public TimeSpan Maximum { get; set; }

Property Value

TimeSpan

Minimum

The lowest possible value.

public TimeSpan Minimum { get; set; }

Property Value

TimeSpan

PickerEditableParts

The picker's editable parts.

public TimeSpanEditableParts PickerEditableParts { get; }

Property Value

TimeSpanEditableParts

ResolvedFormat

The resolved timespan format string.

public string ResolvedFormat { get; }

Property Value

string

SmallChange

The small change value.

public TimeSpan SmallChange { get; set; }

Property Value

TimeSpan:

The default value is 1.1:1:1:1.

Methods

CoerceValidValue(TimeSpan?)

Coerces the value to be within range.

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

The value to coerce.

Returns

TimeSpan?:

The coerced value.

ConvertToString(TimeSpan?)

Converts the specified value to a string representation.

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

The value.

Returns

string:

The string representation of the specified value.

CreateIncrementalChangeRequest(IncrementalChangeRequestKind)

Creates an incremental change (spin) request.

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

The kind of request.

Returns

IncrementalChangeRequest<TimeSpan?>:

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.

IsTextInputAllowed(string)

Indicates whether the input text is allowed if text input filtering is enabled.

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

The text to examine.

Returns

bool:

true if the text input is allowed; otherwise, false.

See Also

IsValidValue(TimeSpan?)

Tests whether the specified value is valid.

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

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

TryConvertFromString(string?, bool, out TimeSpan?)

Tries to convert the specified text to a value.

protected override bool TryConvertFromString(string? textToConvert, bool canCoerce, out TimeSpan? 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 TimeSpan?

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

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

PickerEditablePartsProperty

Defines the PickerEditableParts property.

public static readonly DependencyProperty PickerEditablePartsProperty

ResolvedFormatProperty

Defines the ResolvedFormat property.

public static readonly DependencyProperty ResolvedFormatProperty

SmallChangeProperty

Defines the SmallChange property.

public static readonly DependencyProperty SmallChangeProperty

Inherited Members

Extension Methods