In This Article

DateEditBox Class

Represents a date-only edit box.

[TemplatePart(Name = "PART_Picker", Type = typeof(DatePicker))]
public class DateEditBox : DateTimeEditBox
Inheritance:
object Visual UIElement FrameworkElement Control PartEditBoxBase<DateTime?> DateTimeEditBox object

Constructors

DateEditBox()

Initializes an instance of the DateEditBox class.

public DateEditBox()

Properties

CanRetainTime

Gets or sets whether the various DateTime values can retain the time-portion, or if it is reset to midnight.

public bool CanRetainTime { get; set; }

Property Value

bool:

true if the various DateTime values can retain the time-portion; otherwise, false. The default value is false.

Methods

OnApplyTemplate()

Invoked whenever application code or internal processes call ApplyTemplate.

public override void OnApplyTemplate()

ResetValue()

Resets the value to a default value.

protected override void ResetValue()

TryConvertFromString(string, bool, out 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 bool

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

value DateTime?

Returns the value for the specified text.

Returns

bool:

true if the text was converted to a value successfully; otherwise, false.

Fields

CanRetainTimeProperty

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

public static readonly DependencyProperty CanRetainTimeProperty

Inherited Members