In This Article

DateTimePicker Class

Represents a date/time picker.

[TemplateVisualState(Name = "DateVisible", GroupName = "ComponentVisibilityStates")]
[TemplateVisualState(Name = "TimeVisible", GroupName = "ComponentVisibilityStates")]
public class DateTimePicker : PickerBase
Inheritance:
object Visual UIElement FrameworkElement Control PickerBase object

Constructors

DateTimePicker()

Initializes an instance of the class.

public DateTimePicker()

Properties

IsNullAllowed

Indicates whether null values are allowed to be entered by the user.

public bool IsNullAllowed { get; set; }

Property Value

bool:

true if null values are allowed to be entered by the user; otherwise false. The default value is false.

Maximum

The highest possible value.

public DateTime Maximum { get; set; }

Property Value

DateTime

Minimum

The lowest possible value.

public DateTime Minimum { get; set; }

Property Value

DateTime

Value

The value of the control.

public DateTime? Value { get; set; }

Property Value

DateTime?

Methods

OnApplyTemplate()

When overridden in a derived class, is invoked whenever application code or internal processes call ApplyTemplate().

public override void OnApplyTemplate()

Events

ValueChanged

Occurs after the Value property value changes.

public event EventHandler? ValueChanged

Event Type

EventHandler

Fields

IsNullAllowedProperty

Defines the IsNullAllowed property.

public static readonly DependencyProperty IsNullAllowedProperty

MaximumProperty

Defines the Maximum property.

public static readonly DependencyProperty MaximumProperty

MinimumProperty

Defines the Minimum property.

public static readonly DependencyProperty MinimumProperty

ValueProperty

Defines the Value property.

public static readonly DependencyProperty ValueProperty

Inherited Members

Extension Methods