DateTimeEditBox Class
Represents a date/time edit box.
public class DateTimeEditBox : PartEditBoxBase<DateTime?>, DUCE.IResource, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IHaveResources, IQueryAmbient
- Inheritance:
- Object DispatcherObject DependencyObject Visual UIElement FrameworkElement Control PartEditBoxBase<Nullable<DateTime>> Object
- Derived:
- DateEditBox TimeEditBox
Constructors
DateTimeEditBox()
Initializes an instance of the DateTimeEditBox
class.
public DateTimeEditBox()
Properties
Format
Gets or sets the date/time format string.
public string Format { get; set; }
Property Value
- String:
The date/time 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
.
Maximum
Gets or sets the highest possible value.
Minimum
Gets or sets the lowest possible value.
ResolvedFormat
Gets the resolved date/time format string.
SetValueToNowCommand
Gets the ICommand that sets the value to the current date/time.
public ICommand SetValueToNowCommand { get; }
Property Value
SetValueToTodayCommand
Gets the ICommand that sets the value to the current date.
public ICommand SetValueToTodayCommand { get; }
Property Value
Methods
CoerceParsedValue(Nullable<DateTime>)
Coerces the parsed value from text, which is used for time-only edit boxes to ensure their date doesn't change.
protected virtual DateTime? CoerceParsedValue(DateTime? value)
Parameter | Type | Description |
---|---|---|
value | Nullable<DateTime> | The value to coerce. |
Returns
CoerceValidValue(Nullable<DateTime>)
Coerces the value to be within range.
protected override DateTime? CoerceValidValue(DateTime? value)
Parameter | Type | Description |
---|---|---|
value | Nullable<DateTime> | The value to coerce. |
Returns
ConvertToString(Nullable<DateTime>)
Converts the specified value to a string representation.
protected override string ConvertToString(DateTime? valueToConvert)
Parameter | Type | Description |
---|---|---|
valueToConvert | Nullable<DateTime> | The value. |
Returns
- String:
The string representation of the specified value.
CreateIncrementalChangeRequest(IncrementalChangeRequestKind)
Creates an incremental change (spin) request.
protected override IncrementalChangeRequest<DateTime?> CreateIncrementalChangeRequest(IncrementalChangeRequestKind kind)
Parameter | Type | Description |
---|---|---|
kind | IncrementalChangeRequestKind | The kind of request. |
Returns
- IncrementalChangeRequest<Nullable<DateTime>>:
The incremental change (spin) request that was created.
GenerateParts()
Generates the parts for the edit box.
protected override IList<IPart> GenerateParts()
Returns
IsValidValue(Nullable<DateTime>)
Returns whether the specified value is valid.
protected override bool IsValidValue(DateTime? value)
Parameter | Type | Description |
---|---|---|
value | Nullable<DateTime> | 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<DateTime>)
Tries to convert the specified text to a value.
protected override bool TryConvertFromString(string textToConvert, bool canCoerce, out DateTime? 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<DateTime> | 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
FormatProperty
Identifies the Format dependency property. This field is read-only.
public static readonly DependencyProperty FormatProperty
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
ResolvedFormatProperty
Identifies the ResolvedFormat dependency property. This field is read-only.
public static readonly DependencyProperty ResolvedFormatProperty
Inherited Members
- PartEditBoxBase<Nullable<DateTime>>.ActivePartIndexProperty
- PartEditBoxBase<Nullable<DateTime>>.CommitTriggersProperty
- PartEditBoxBase<Nullable<DateTime>>.HasPopupProperty
- PartEditBoxBase<Nullable<DateTime>>.InlinesProperty
- PartEditBoxBase<Nullable<DateTime>>.InputScopeNameValueProperty
- PartEditBoxBase<Nullable<DateTime>>.IntermediateValueProperty
- PartEditBoxBase<Nullable<DateTime>>.IsArrowKeyPartNavigationEnabledProperty
- PartEditBoxBase<Nullable<DateTime>>.IsEditableProperty
- PartEditBoxBase<Nullable<DateTime>>.IsNullAllowedProperty
- PartEditBoxBase<Nullable<DateTime>>.IsPopupButtonVisibleProperty
- PartEditBoxBase<Nullable<DateTime>>.IsPopupOpenProperty
- PartEditBoxBase<Nullable<DateTime>>.IsReadOnlyProperty
- PartEditBoxBase<Nullable<DateTime>>.IsSpinnerVisibleProperty
- PartEditBoxBase<Nullable<DateTime>>.IsUndoEnabledProperty
- PartEditBoxBase<Nullable<DateTime>>.PlaceholderTextProperty
- PartEditBoxBase<Nullable<DateTime>>.PopupBackgroundProperty
- PartEditBoxBase<Nullable<DateTime>>.PopupBorderBrushProperty
- PartEditBoxBase<Nullable<DateTime>>.PopupPickerStyleProperty
- PartEditBoxBase<Nullable<DateTime>>.SpinWrappingProperty
- PartEditBoxBase<Nullable<DateTime>>.TextAlignmentProperty
- PartEditBoxBase<Nullable<DateTime>>.ValueProperty
- PartEditBoxBase<Nullable<DateTime>>.IsNonDefaultUsageContextProperty
- PartEditBoxBase<Nullable<DateTime>>.SpinnerVisibilityProperty
- PartEditBoxBase<Nullable<DateTime>>.UsageContextProperty
- PartEditBoxBase<Nullable<DateTime>>.Commit()
- PartEditBoxBase<Nullable<DateTime>>.Commit(Boolean)
- PartEditBoxBase<Nullable<DateTime>>.InvalidateParts()
- PartEditBoxBase<Nullable<DateTime>>.OnApplyTemplate()
- PartEditBoxBase<Nullable<DateTime>>.OnCreateAutomationPeer()
- PartEditBoxBase<Nullable<DateTime>>.OnGotFocus(RoutedEventArgs)
- PartEditBoxBase<Nullable<DateTime>>.OnIntermediateValueChanged(Nullable<DateTime>, Nullable<DateTime>)
- PartEditBoxBase<Nullable<DateTime>>.OnIsNullAllowedChanged(Boolean, Boolean)
- PartEditBoxBase<Nullable<DateTime>>.OnKeyDown(KeyEventArgs)
- PartEditBoxBase<Nullable<DateTime>>.OnLostFocus(RoutedEventArgs)
- PartEditBoxBase<Nullable<DateTime>>.OnPopupOpened()
- PartEditBoxBase<Nullable<DateTime>>.OnValueChanged(Nullable<DateTime>, Nullable<DateTime>)
- PartEditBoxBase<Nullable<DateTime>>.ProcessTextInput(String)
- PartEditBoxBase<Nullable<DateTime>>.SelectAll()
- PartEditBoxBase<Nullable<DateTime>>.OnIsKeyboardFocusWithinChanged(DependencyPropertyChangedEventArgs)
- PartEditBoxBase<Nullable<DateTime>>.OnLostMouseCapture(MouseEventArgs)
- PartEditBoxBase<Nullable<DateTime>>.OnMouseLeftButtonDown(MouseButtonEventArgs)
- PartEditBoxBase<Nullable<DateTime>>.OnPreviewMouseUp(MouseButtonEventArgs)
- PartEditBoxBase<Nullable<DateTime>>.OnPreviewTextInput(TextCompositionEventArgs)
- PartEditBoxBase<Nullable<DateTime>>.ActivePartIndex
- PartEditBoxBase<Nullable<DateTime>>.CommitTriggers
- PartEditBoxBase<Nullable<DateTime>>.CurrentSelectionLength
- PartEditBoxBase<Nullable<DateTime>>.CurrentSelectionStartOffset
- PartEditBoxBase<Nullable<DateTime>>.CurrentText
- PartEditBoxBase<Nullable<DateTime>>.HasPopup
- PartEditBoxBase<Nullable<DateTime>>.Inlines
- PartEditBoxBase<Nullable<DateTime>>.InputScopeNameValue
- PartEditBoxBase<Nullable<DateTime>>.IntermediateValue
- PartEditBoxBase<Nullable<DateTime>>.IsArrowKeyPartNavigationEnabled
- PartEditBoxBase<Nullable<DateTime>>.IsEditable
- PartEditBoxBase<Nullable<DateTime>>.IsNullAllowed
- PartEditBoxBase<Nullable<DateTime>>.IsPopupButtonVisible
- PartEditBoxBase<Nullable<DateTime>>.IsPopupOpen
- PartEditBoxBase<Nullable<DateTime>>.IsReadOnly
- PartEditBoxBase<Nullable<DateTime>>.IsSpinnerVisible
- PartEditBoxBase<Nullable<DateTime>>.IsUndoEnabled
- PartEditBoxBase<Nullable<DateTime>>.Parts
- PartEditBoxBase<Nullable<DateTime>>.PlaceholderText
- PartEditBoxBase<Nullable<DateTime>>.PopupBackground
- PartEditBoxBase<Nullable<DateTime>>.PopupBorderBrush
- PartEditBoxBase<Nullable<DateTime>>.PopupPickerStyle
- PartEditBoxBase<Nullable<DateTime>>.ResetValueCommand
- PartEditBoxBase<Nullable<DateTime>>.SmallDecrementValueCommand
- PartEditBoxBase<Nullable<DateTime>>.SmallIncrementValueCommand
- PartEditBoxBase<Nullable<DateTime>>.SpinWrapping
- PartEditBoxBase<Nullable<DateTime>>.TextAlignment
- PartEditBoxBase<Nullable<DateTime>>.Value
- PartEditBoxBase<Nullable<DateTime>>.IsNonDefaultUsageContext
- PartEditBoxBase<Nullable<DateTime>>.SpinnerVisibility
- PartEditBoxBase<Nullable<DateTime>>.UsageContext
- Object.ToString()
- Object.Equals(Object)
- Object.Equals(Object, Object)
- Object.ReferenceEquals(Object, Object)
- Object.GetHashCode()
- Object.GetType()
- Object.MemberwiseClone()
Extension Methods
- FrameworkElementExtensions.AnimateDoubleProperty(String, Double, Double, Double, Nullable<Double>, Nullable<Double>)
- FrameworkElementExtensions.BindToProperty(DependencyProperty, Object, String, BindingMode, IValueConverter, Object)
- FrameworkElementExtensions.BindToProperty(DependencyProperty, Object, DependencyProperty, BindingMode, IValueConverter, Object)
- FrameworkElementExtensions.GetCurrentSize()