Vixen
feb85697
csharp
public sealed class Calendar

A month of days to choose one from.

Read the guide page for this →

Remarks

The first half of doc 49 § 7.1's rank 5, and the half a date picker is made of. Always six weeks of seven days, the days either side of the month drawn and marked .outside — so the grid is the same height in February as in August, on Pagination's argument that a control whose size moves as you page through it moves the thing you were about to click.

⚠ The week starts where the culture says it does, and the names are the culture's. Culture decides the first day of the week, the weekday headings, the month title and every cell's spoken date. null is the invariant culture — Sunday first, English names — on Culture's terms: a control that quietly followed the thread's culture would change what every calendar prints on a machine setting nobody in the application chose.

⚠ ARIA's date-picker grid, keyboard included. One day is the tab stop — the chosen one, or today's — and the arrows move it: a day either way, a week up and down, Home and End to the ends of the week, Page Up and Page Down a month, and with Shift a year. Moving onto a day of another month shows that month, so the focus never leaves the grid. Enter and Space choose, as a click does.

Two nodes in the tree: a group round the whole calendar and a grid round the days, both named by the month title through LabelledBy, so a reader entering the grid hears "September 2026" and then the day. The weekday headings are columnheaders whose names are the full day names; the cells show the shortest.

Fields and properties (18)

  • protected override string TagName

    The element name this type answers to when a caller does not choose one.

  • protected override bool AcceptsFocus
  • protected override AccessibleRole NativeRole

    The role this kind of element has when nobody says otherwise.

  • public UiElement Header

    The row across the top: the two arrows and the month between them.

  • public UiElement Title

    The month and year being shown, which names the calendar and its grid.

  • public IconButton Previous

    The arrow that shows the month before.

  • public IconButton Next

    The arrow that shows the month after.

  • public UiElement Grid

    The weekday headings and the six weeks under them.

  • public IReadOnlyList<CalendarDay> Days

    The forty-two days on show, a week at a time from the top left.

  • public DateOnly? Value
  • public DateOnly? Minimum
  • public DateOnly? Maximum
  • public DateOnly Month

    The month on show, as its first day.

  • public DateOnly Today

    Which day is marked as today.

  • public CultureInfo? Culture

    Which locale's week, names and date formats the calendar uses. null is invariant.

  • public static readonly UiPropertyKey ValueProperty

    Identity for Value.

  • public static readonly UiPropertyKey MinimumProperty

    Identity for Minimum.

  • public static readonly UiPropertyKey MaximumProperty

    Identity for Maximum.

Events (1)

  • public Action<Calendar, DateOnly?>? ValueChanged

    Raised when the chosen date changes.

Methods (5)

  • protected override void OnCreated()

    Builds whatever this element is made of, once, as it joins a document.

  • public CalendarDay? DayOf(DateOnly date)

    The cell showing a date, if it is on show.

  • public void ClearValue()

    Unsets Value, so it takes its default or its ancestor's value again.

  • public void ClearMinimum()

    Unsets Minimum, so it takes its default or its ancestor's value again.

  • public void ClearMaximum()

    Unsets Maximum, so it takes its default or its ancestor's value again.

Used by (3)

  • CalendarTestsVixen.Ui.Controls.Tests
  • DatePickerVixen.Ui.Controls
  • DatePickerTestsVixen.Ui.Controls.Tests