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 TimeSpanEditBox class.

public TimeSpanEditBox()

Properties

DefaultValue

Gets or sets the value to set when incrementing/decrementing from a null value.

public TimeSpan DefaultValue { get; set; }

Property Value

TimeSpan:

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

Format

Gets or sets the timespan format string.

public string Format { get; set; }

Property Value

string:

The timespan format string. The default value is "g".

HasPopupButtonWhenReadOnly

Gets 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

Gets or sets the large change value.

public TimeSpan LargeChange { get; set; }

Property Value

TimeSpan:

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

Maximum

Gets or sets the highest possible value.

public TimeSpan Maximum { get; set; }

Property Value

TimeSpan:

The highest possible value.

Minimum

Gets or sets the lowest possible value.

public TimeSpan Minimum { get; set; }

Property Value

TimeSpan:

The lowest possible value.

PickerEditableParts

Gets the picker's editable parts.

public TimeSpanEditableParts PickerEditableParts { get; }

Property Value

TimeSpanEditableParts:

The picker's editable parts.

ResolvedFormat

Gets the resolved timespan format string.

public string ResolvedFormat { get; }

Property Value

string:

The resolved timespan format string.

SmallChange

Gets or sets the small change value.

public TimeSpan SmallChange { get; set; }

Property Value

TimeSpan:

The small change value. 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.

IsValidValue(TimeSpan?)

Returns 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.

RaiseValueChangedEvent()

Raises the ValueChanged event.

protected override void RaiseValueChangedEvent()

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.

Events

ValueChanged

Occurs after the Value property value changes.

public event EventHandler ValueChanged

Event Type

EventHandler

Fields

DefaultValueProperty

Identifies the DefaultValue dependency property. This field is read-only.

public static readonly DependencyProperty DefaultValueProperty

FormatProperty

Identifies the Format dependency property. This field is read-only.

public static readonly DependencyProperty FormatProperty

LargeChangeProperty

Identifies the LargeChange dependency property. This field is read-only.

public static readonly DependencyProperty LargeChangeProperty

MaximumProperty

Identifies the Maximum dependency property. This field is read-only.

public static readonly DependencyProperty MaximumProperty

MinimumProperty

Identifies the Minimum dependency property. This field is read-only.

public static readonly DependencyProperty MinimumProperty

PickerEditablePartsProperty

Identifies the PickerEditableParts dependency property. This field is read-only.

public static readonly DependencyProperty PickerEditablePartsProperty

ResolvedFormatProperty

Identifies the ResolvedFormat dependency property. This field is read-only.

public static readonly DependencyProperty ResolvedFormatProperty

SmallChangeProperty

Identifies the SmallChange dependency property. This field is read-only.

public static readonly DependencyProperty SmallChangeProperty

Inherited Members