Skip to main content

SelectedDate Property

Gets or sets the currently selected date.

Definition

Namespace: Avalonia.Controls
Assembly: Avalonia.Controls (in Avalonia.Controls.dll)

public DateTime? SelectedDate { get; set; }

Property Value

Nullable(DateTime)
The date currently selected. The default is null.

Remarks

Use this property when SelectionMode is set to SingleDate. In other modes, this property will always be the first date in SelectedDates.

Exceptions

ArgumentOutOfRangeExceptionThe given date is outside the range specified by DisplayDateStart and DisplayDateEnd -or- The given date is in the BlackoutDates collection.
InvalidOperationExceptionIf set to anything other than null when SelectionMode is set to None.

See Also

Reference

Calendar Class
Avalonia.Controls Namespace