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.
Minimum
Gets or sets 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.
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
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.
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
- PartEditBoxBase<TimeSpan?>.ActivePartIndexProperty
- PartEditBoxBase<TimeSpan?>.CommitTriggersProperty
- PartEditBoxBase<TimeSpan?>.HasPopupProperty
- PartEditBoxBase<TimeSpan?>.InlinesProperty
- PartEditBoxBase<TimeSpan?>.InputScopeNameValueProperty
- PartEditBoxBase<TimeSpan?>.IntermediateValueProperty
- PartEditBoxBase<TimeSpan?>.IsArrowKeyPartNavigationEnabledProperty
- PartEditBoxBase<TimeSpan?>.IsEditableProperty
- PartEditBoxBase<TimeSpan?>.IsNullAllowedProperty
- PartEditBoxBase<TimeSpan?>.IsPopupButtonVisibleProperty
- PartEditBoxBase<TimeSpan?>.IsPopupOpenProperty
- PartEditBoxBase<TimeSpan?>.IsReadOnlyProperty
- PartEditBoxBase<TimeSpan?>.IsSpinnerVisibleProperty
- PartEditBoxBase<TimeSpan?>.IsUndoEnabledProperty
- PartEditBoxBase<TimeSpan?>.PlaceholderTextProperty
- PartEditBoxBase<TimeSpan?>.PopupBackgroundProperty
- PartEditBoxBase<TimeSpan?>.PopupBorderBrushProperty
- PartEditBoxBase<TimeSpan?>.PopupPickerStyleProperty
- PartEditBoxBase<TimeSpan?>.SpinWrappingProperty
- PartEditBoxBase<TimeSpan?>.TextAlignmentProperty
- PartEditBoxBase<TimeSpan?>.ValueProperty
- PartEditBoxBase<TimeSpan?>.IsNonDefaultUsageContextProperty
- PartEditBoxBase<TimeSpan?>.SpinnerVisibilityProperty
- PartEditBoxBase<TimeSpan?>.UsageContextProperty
- PartEditBoxBase<TimeSpan?>.Commit()
- PartEditBoxBase<TimeSpan?>.Commit(bool)
- PartEditBoxBase<TimeSpan?>.InvalidateParts()
- PartEditBoxBase<TimeSpan?>.OnApplyTemplate()
- PartEditBoxBase<TimeSpan?>.OnCreateAutomationPeer()
- PartEditBoxBase<TimeSpan?>.OnGotFocus(RoutedEventArgs)
- PartEditBoxBase<TimeSpan?>.OnIntermediateValueChanged(TimeSpan?, TimeSpan?)
- PartEditBoxBase<TimeSpan?>.OnIsNullAllowedChanged(bool, bool)
- PartEditBoxBase<TimeSpan?>.OnKeyDown(KeyEventArgs)
- PartEditBoxBase<TimeSpan?>.OnLostFocus(RoutedEventArgs)
- PartEditBoxBase<TimeSpan?>.OnPopupOpened()
- PartEditBoxBase<TimeSpan?>.OnValueChanged(TimeSpan?, TimeSpan?)
- PartEditBoxBase<TimeSpan?>.ProcessTextInput(string)
- PartEditBoxBase<TimeSpan?>.SelectAll()
- PartEditBoxBase<TimeSpan?>.UpdateIntermediateValueAndTextFromValue()
- PartEditBoxBase<TimeSpan?>.OnIsKeyboardFocusWithinChanged(DependencyPropertyChangedEventArgs)
- PartEditBoxBase<TimeSpan?>.OnLostMouseCapture(MouseEventArgs)
- PartEditBoxBase<TimeSpan?>.OnMouseLeftButtonDown(MouseButtonEventArgs)
- PartEditBoxBase<TimeSpan?>.OnPreviewMouseUp(MouseButtonEventArgs)
- PartEditBoxBase<TimeSpan?>.OnPreviewTextInput(TextCompositionEventArgs)
- PartEditBoxBase<TimeSpan?>.ActivePartIndex
- PartEditBoxBase<TimeSpan?>.CommitTriggers
- PartEditBoxBase<TimeSpan?>.CurrentSelectionLength
- PartEditBoxBase<TimeSpan?>.CurrentSelectionStartOffset
- PartEditBoxBase<TimeSpan?>.CurrentText
- PartEditBoxBase<TimeSpan?>.HasPopup
- PartEditBoxBase<TimeSpan?>.Inlines
- PartEditBoxBase<TimeSpan?>.InputScopeNameValue
- PartEditBoxBase<TimeSpan?>.IntermediateValue
- PartEditBoxBase<TimeSpan?>.IsArrowKeyPartNavigationEnabled
- PartEditBoxBase<TimeSpan?>.IsEditable
- PartEditBoxBase<TimeSpan?>.IsNullAllowed
- PartEditBoxBase<TimeSpan?>.IsPopupButtonVisible
- PartEditBoxBase<TimeSpan?>.IsPopupOpen
- PartEditBoxBase<TimeSpan?>.IsReadOnly
- PartEditBoxBase<TimeSpan?>.IsSpinnerVisible
- PartEditBoxBase<TimeSpan?>.IsUndoEnabled
- PartEditBoxBase<TimeSpan?>.Parts
- PartEditBoxBase<TimeSpan?>.PlaceholderText
- PartEditBoxBase<TimeSpan?>.PopupBackground
- PartEditBoxBase<TimeSpan?>.PopupBorderBrush
- PartEditBoxBase<TimeSpan?>.PopupPickerStyle
- PartEditBoxBase<TimeSpan?>.ResetValueCommand
- PartEditBoxBase<TimeSpan?>.SmallDecrementValueCommand
- PartEditBoxBase<TimeSpan?>.SmallIncrementValueCommand
- PartEditBoxBase<TimeSpan?>.SpinWrapping
- PartEditBoxBase<TimeSpan?>.TextAlignment
- PartEditBoxBase<TimeSpan?>.Value
- PartEditBoxBase<TimeSpan?>.IsNonDefaultUsageContext
- PartEditBoxBase<TimeSpan?>.SpinnerVisibility
- PartEditBoxBase<TimeSpan?>.UsageContext