Class DatePicker
Represents a control that allows the user to select a date.
Inheritance
Inherited Members
Namespace: System.Windows.Controls
Assembly: OpenSilver.dll
Syntax
public class DatePicker : INTERNAL_DateTimePickerBase
Constructors
| Improve this Doc View SourceDatePicker()
Declaration
public DatePicker()
Fields
| Improve this Doc View SourceCalendarStyleProperty
Declaration
[NotImplemented]
public static readonly DependencyProperty CalendarStyleProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
DisplayDateEndProperty
Identifies the DisplayDateEnd dependency property.
Declaration
[NotImplemented]
public static readonly DependencyProperty DisplayDateEndProperty
Field Value
Type | Description |
---|---|
DependencyProperty | The identifier for the DisplayDateEnd dependency property. |
DisplayDateProperty
Identifies the DisplayDate dependency property.
Declaration
[NotImplemented]
public static readonly DependencyProperty DisplayDateProperty
Field Value
Type | Description |
---|---|
DependencyProperty | The identifier for the DisplayDate dependency property. |
DisplayDateStartProperty
Identifies the DisplayDateStart dependency property.
Declaration
[NotImplemented]
public static readonly DependencyProperty DisplayDateStartProperty
Field Value
Type | Description |
---|---|
DependencyProperty | The identifier for the DisplayDateStart dependency property. |
IsTodayHighlightedProperty
Identifies the IsTodayHighlighted dependency property.
Declaration
[NotImplemented]
public static readonly DependencyProperty IsTodayHighlightedProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
SelectedDateFormatProperty
Declaration
public static readonly DependencyProperty SelectedDateFormatProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
SelectedDateProperty
Identifies the dependency property.
Declaration
public static readonly DependencyProperty SelectedDateProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
SelectionBackgroundProperty
Identifies the SelectionBackground dependency property.
Declaration
[NotImplemented]
public static readonly DependencyProperty SelectionBackgroundProperty
Field Value
Type | Description |
---|---|
DependencyProperty | The identifier for the SelectionBackground dependency property. |
Properties
| Improve this Doc View SourceBlackoutDates
Gets or sets a collection of dates that are marked as not selectable.
Declaration
[NotImplemented]
public CalendarBlackoutDatesCollection BlackoutDates { get; }
Property Value
Type | Description |
---|---|
CalendarBlackoutDatesCollection | A collection of dates that cannot be selected. The default value is an empty collection. |
CalendarStyle
Declaration
[NotImplemented]
public Style CalendarStyle { get; set; }
Property Value
Type | Description |
---|---|
Style |
DisplayDate
Gets or sets the date to display.
Declaration
[NotImplemented]
public DateTime DisplayDate { get; set; }
Property Value
Type | Description |
---|---|
System.DateTime | The date to display. The default System.DateTime.Today. |
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | The specified date is not in the range defined by DisplayDateStart and DisplayDateEnd. |
DisplayDateEnd
Gets or sets the last date to be displayed.
Declaration
[NotImplemented]
public DateTime? DisplayDateEnd { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.DateTime> | The last date to display. |
DisplayDateStart
Gets or sets the first date to be displayed.
Declaration
[NotImplemented]
public DateTime? DisplayDateStart { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.DateTime> | The first date to display. |
IsTodayHighlighted
Gets or sets a value that indicates whether the current date will be highlighted.
Declaration
[NotImplemented]
public bool IsTodayHighlighted { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
SelectedDate
Gets or sets the currently selected date.
Declaration
public DateTime? SelectedDate { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.DateTime> |
SelectedDateFormat
Declaration
public DatePickerFormat SelectedDateFormat { get; set; }
Property Value
Type | Description |
---|---|
DatePickerFormat |
SelectionBackground
Gets or sets the background used for selected dates.
Declaration
[NotImplemented]
public Brush SelectionBackground { get; set; }
Property Value
Type | Description |
---|---|
Brush | The background used for selected dates. |
Methods
| Improve this Doc View SourceGenerateCalendarOrClock()
Declaration
protected override INTERNAL_CalendarOrClockBase GenerateCalendarOrClock()
Returns
Type | Description |
---|---|
INTERNAL_CalendarOrClockBase |
Overrides
| Improve this Doc View SourceOnApplyTemplate()
Declaration
public override void OnApplyTemplate()
Overrides
| Improve this Doc View SourceOnEmptyText()
Declaration
protected override void OnEmptyText()
Overrides
| Improve this Doc View SourceOnSelectionChanged(Nullable<DateTime>)
Declaration
protected override void OnSelectionChanged(DateTime? newSelectedDate)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.DateTime> | newSelectedDate |
Overrides
| Improve this Doc View SourceOnTextChanged()
Declaration
protected override void OnTextChanged()
Overrides
| Improve this Doc View SourceSetTextFromDate(Nullable<DateTime>)
Declaration
protected override string SetTextFromDate(DateTime? newDate)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.DateTime> | newDate |
Returns
Type | Description |
---|---|
System.String |
Overrides
| Improve this Doc View SourceSetWaterMarkText()
Declaration
protected override void SetWaterMarkText()
Overrides
Events
| Improve this Doc View SourceCalendarClosed
Declaration
[NotImplemented]
public event RoutedEventHandler CalendarClosed
Event Type
Type | Description |
---|---|
RoutedEventHandler |
CalendarOpened
Occurs when the drop-down Calendar is opened.
Declaration
[NotImplemented]
public event RoutedEventHandler CalendarOpened
Event Type
Type | Description |
---|---|
RoutedEventHandler |
DateValidationError
Occurs when System.Windows.Controls.DatePicker.Text is assigned a value that cannot be interpreted as a date.
Declaration
[NotImplemented]
public event EventHandler<DatePickerDateValidationErrorEventArgs> DateValidationError
Event Type
Type | Description |
---|---|
System.EventHandler<DatePickerDateValidationErrorEventArgs> |