In This Article

DateTimeEditBox Class

Represents a date/time edit box.

public class DateTimeEditBox : PartEditBoxBase<DateTime?>, DUCE.IResource, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IHaveResources, IQueryAmbient
Inheritance:
System.Object System.Windows.Threading.DispatcherObject System.Windows.DependencyObject System.Windows.Media.Visual System.Windows.UIElement System.Windows.FrameworkElement System.Windows.Controls.Control PartEditBoxBase<System.Nullable<System.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

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

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

public DateTime Maximum { get; set; }

Property Value

System.DateTime:

The highest possible value.

Minimum

Gets or sets the lowest possible value.

public DateTime Minimum { get; set; }

Property Value

System.DateTime:

The lowest possible value.

ResolvedFormat

Gets the resolved date/time format string.

public string ResolvedFormat { get; }

Property Value

System.String:

The resolved date/time format string.

SetValueToNowCommand

Gets the System.Windows.Input.ICommand that sets the value to the current date/time.

public ICommand SetValueToNowCommand { get; }

Property Value

System.Windows.Input.ICommand:

The System.Windows.Input.ICommand that sets the value to the current date/time.

SetValueToTodayCommand

Gets the System.Windows.Input.ICommand that sets the value to the current date.

public ICommand SetValueToTodayCommand { get; }

Property Value

System.Windows.Input.ICommand:

The System.Windows.Input.ICommand that sets the value to the current date.

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 System.Nullable<System.DateTime>

The value to coerce.

Returns

System.Nullable<System.DateTime>:

The coerced value.

CoerceValidValue(Nullable<DateTime>)

Coerces the value to be within range.

protected override DateTime? CoerceValidValue(DateTime? value)
Parameter Type Description
value System.Nullable<System.DateTime>

The value to coerce.

Returns

System.Nullable<System.DateTime>:

The coerced value.

ConvertToString(Nullable<DateTime>)

Converts the specified value to a string representation.

protected override string ConvertToString(DateTime? valueToConvert)
Parameter Type Description
valueToConvert System.Nullable<System.DateTime>

The value.

Returns

System.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<System.Nullable<System.DateTime>>:

The incremental change (spin) request that was created.

GenerateParts()

Generates the parts for the edit box.

protected override IList<IPart> GenerateParts()

Returns

System.Collections.Generic.IList<IPart>:

The parts that were generated.

IsValidValue(Nullable<DateTime>)

Returns whether the specified value is valid.

protected override bool IsValidValue(DateTime? value)
Parameter Type Description
value System.Nullable<System.DateTime>

The value to examine.

Returns

System.Boolean:

true if the value is valid; otherwise, false.

OnPopupOpened()

Occurs when the popup is opened.

protected override void OnPopupOpened()

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 System.String

The text.

canCoerce System.Boolean

Whether the returned value should be coerced to fall within the allowed value range.

value System.Nullable<System.DateTime>

Returns the value for the specified text.

Returns

System.Boolean:

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

System.EventHandler

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

Extension Methods