TimeSpanEditBox Class
Represents a timespan edit box.
public class TimeSpanEditBox : PartEditBoxBase<TimeSpan?>, DUCE.IResource, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IHaveResources, IQueryAmbient
- Inheritance:
- Object DispatcherObject DependencyObject Visual UIElement FrameworkElement Control PartEditBoxBase<Nullable<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
- Boolean:
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(Nullable<TimeSpan>)
Coerces the value to be within range.
protected override TimeSpan? CoerceValidValue(TimeSpan? value)
Parameter | Type | Description |
---|---|---|
value | Nullable<TimeSpan> | The value to coerce. |
Returns
ConvertToString(Nullable<TimeSpan>)
Converts the specified value to a string representation.
protected override string ConvertToString(TimeSpan? valueToConvert)
Parameter | Type | Description |
---|---|---|
valueToConvert | Nullable<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<Nullable<TimeSpan>>:
The incremental change (spin) request that was created.
GenerateParts()
Generates the parts for the edit box.
protected override IList<IPart> GenerateParts()
Returns
IsValidValue(Nullable<TimeSpan>)
Returns whether the specified value is valid.
protected override bool IsValidValue(TimeSpan? value)
Parameter | Type | Description |
---|---|---|
value | Nullable<TimeSpan> | The value to examine. |
Returns
- Boolean:
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, Boolean, out Nullable<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 | Boolean | Whether the returned value should be coerced to fall within the allowed value range. |
value | Nullable<TimeSpan> | Returns the value for the specified text. |
Returns
- Boolean:
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<Nullable<TimeSpan>>.ActivePartIndexProperty
- PartEditBoxBase<Nullable<TimeSpan>>.CommitTriggersProperty
- PartEditBoxBase<Nullable<TimeSpan>>.HasPopupProperty
- PartEditBoxBase<Nullable<TimeSpan>>.InlinesProperty
- PartEditBoxBase<Nullable<TimeSpan>>.InputScopeNameValueProperty
- PartEditBoxBase<Nullable<TimeSpan>>.IntermediateValueProperty
- PartEditBoxBase<Nullable<TimeSpan>>.IsArrowKeyPartNavigationEnabledProperty
- PartEditBoxBase<Nullable<TimeSpan>>.IsEditableProperty
- PartEditBoxBase<Nullable<TimeSpan>>.IsNullAllowedProperty
- PartEditBoxBase<Nullable<TimeSpan>>.IsPopupButtonVisibleProperty
- PartEditBoxBase<Nullable<TimeSpan>>.IsPopupOpenProperty
- PartEditBoxBase<Nullable<TimeSpan>>.IsReadOnlyProperty
- PartEditBoxBase<Nullable<TimeSpan>>.IsSpinnerVisibleProperty
- PartEditBoxBase<Nullable<TimeSpan>>.IsUndoEnabledProperty
- PartEditBoxBase<Nullable<TimeSpan>>.PlaceholderTextProperty
- PartEditBoxBase<Nullable<TimeSpan>>.PopupBackgroundProperty
- PartEditBoxBase<Nullable<TimeSpan>>.PopupBorderBrushProperty
- PartEditBoxBase<Nullable<TimeSpan>>.PopupPickerStyleProperty
- PartEditBoxBase<Nullable<TimeSpan>>.SpinWrappingProperty
- PartEditBoxBase<Nullable<TimeSpan>>.TextAlignmentProperty
- PartEditBoxBase<Nullable<TimeSpan>>.ValueProperty
- PartEditBoxBase<Nullable<TimeSpan>>.IsNonDefaultUsageContextProperty
- PartEditBoxBase<Nullable<TimeSpan>>.SpinnerVisibilityProperty
- PartEditBoxBase<Nullable<TimeSpan>>.UsageContextProperty
- PartEditBoxBase<Nullable<TimeSpan>>.Commit()
- PartEditBoxBase<Nullable<TimeSpan>>.Commit(Boolean)
- PartEditBoxBase<Nullable<TimeSpan>>.InvalidateParts()
- PartEditBoxBase<Nullable<TimeSpan>>.OnApplyTemplate()
- PartEditBoxBase<Nullable<TimeSpan>>.OnCreateAutomationPeer()
- PartEditBoxBase<Nullable<TimeSpan>>.OnGotFocus(RoutedEventArgs)
- PartEditBoxBase<Nullable<TimeSpan>>.OnIntermediateValueChanged(Nullable<TimeSpan>, Nullable<TimeSpan>)
- PartEditBoxBase<Nullable<TimeSpan>>.OnIsNullAllowedChanged(Boolean, Boolean)
- PartEditBoxBase<Nullable<TimeSpan>>.OnKeyDown(KeyEventArgs)
- PartEditBoxBase<Nullable<TimeSpan>>.OnLostFocus(RoutedEventArgs)
- PartEditBoxBase<Nullable<TimeSpan>>.OnPopupOpened()
- PartEditBoxBase<Nullable<TimeSpan>>.OnValueChanged(Nullable<TimeSpan>, Nullable<TimeSpan>)
- PartEditBoxBase<Nullable<TimeSpan>>.ProcessTextInput(String)
- PartEditBoxBase<Nullable<TimeSpan>>.SelectAll()
- PartEditBoxBase<Nullable<TimeSpan>>.OnIsKeyboardFocusWithinChanged(DependencyPropertyChangedEventArgs)
- PartEditBoxBase<Nullable<TimeSpan>>.OnLostMouseCapture(MouseEventArgs)
- PartEditBoxBase<Nullable<TimeSpan>>.OnMouseLeftButtonDown(MouseButtonEventArgs)
- PartEditBoxBase<Nullable<TimeSpan>>.OnPreviewMouseUp(MouseButtonEventArgs)
- PartEditBoxBase<Nullable<TimeSpan>>.OnPreviewTextInput(TextCompositionEventArgs)
- PartEditBoxBase<Nullable<TimeSpan>>.ActivePartIndex
- PartEditBoxBase<Nullable<TimeSpan>>.CommitTriggers
- PartEditBoxBase<Nullable<TimeSpan>>.CurrentSelectionLength
- PartEditBoxBase<Nullable<TimeSpan>>.CurrentSelectionStartOffset
- PartEditBoxBase<Nullable<TimeSpan>>.CurrentText
- PartEditBoxBase<Nullable<TimeSpan>>.HasPopup
- PartEditBoxBase<Nullable<TimeSpan>>.Inlines
- PartEditBoxBase<Nullable<TimeSpan>>.InputScopeNameValue
- PartEditBoxBase<Nullable<TimeSpan>>.IntermediateValue
- PartEditBoxBase<Nullable<TimeSpan>>.IsArrowKeyPartNavigationEnabled
- PartEditBoxBase<Nullable<TimeSpan>>.IsEditable
- PartEditBoxBase<Nullable<TimeSpan>>.IsNullAllowed
- PartEditBoxBase<Nullable<TimeSpan>>.IsPopupButtonVisible
- PartEditBoxBase<Nullable<TimeSpan>>.IsPopupOpen
- PartEditBoxBase<Nullable<TimeSpan>>.IsReadOnly
- PartEditBoxBase<Nullable<TimeSpan>>.IsSpinnerVisible
- PartEditBoxBase<Nullable<TimeSpan>>.IsUndoEnabled
- PartEditBoxBase<Nullable<TimeSpan>>.Parts
- PartEditBoxBase<Nullable<TimeSpan>>.PlaceholderText
- PartEditBoxBase<Nullable<TimeSpan>>.PopupBackground
- PartEditBoxBase<Nullable<TimeSpan>>.PopupBorderBrush
- PartEditBoxBase<Nullable<TimeSpan>>.PopupPickerStyle
- PartEditBoxBase<Nullable<TimeSpan>>.ResetValueCommand
- PartEditBoxBase<Nullable<TimeSpan>>.SmallDecrementValueCommand
- PartEditBoxBase<Nullable<TimeSpan>>.SmallIncrementValueCommand
- PartEditBoxBase<Nullable<TimeSpan>>.SpinWrapping
- PartEditBoxBase<Nullable<TimeSpan>>.TextAlignment
- PartEditBoxBase<Nullable<TimeSpan>>.Value
- PartEditBoxBase<Nullable<TimeSpan>>.IsNonDefaultUsageContext
- PartEditBoxBase<Nullable<TimeSpan>>.SpinnerVisibility
- PartEditBoxBase<Nullable<TimeSpan>>.UsageContext
- Object.ToString()
- Object.Equals(Object)
- Object.Equals(Object, Object)
- Object.ReferenceEquals(Object, Object)
- Object.GetHashCode()
- Object.GetType()
- Object.MemberwiseClone()