Skip to content

CalendarExtensions

Namespace: Hex1b

Assembly: Hex1b.dll

Extension methods for creating instances using the fluent builder API.

csharp
public static class CalendarExtensions

Inheritance

ObjectCalendarExtensions

Methods

Calendar<TParent>(WidgetContext<TParent>, DateOnly)

Creates a calendar widget displaying the specified month.

Parameters:

  • ctx (WidgetContext<<TParent>>): The parent widget context.
  • month (DateOnly): The month to display. Only the Year and Month components are used.

Returns: CalendarWidget

A configured .

csharp
public static CalendarWidget Calendar<TParent>(this WidgetContext<TParent> ctx, DateOnly month) where TParent : Hex1bWidget

Calendar<TParent>(WidgetContext<TParent>, int, int)

Creates a calendar widget displaying the specified year and month.

Parameters:

  • ctx (WidgetContext<<TParent>>): The parent widget context.
  • year (Int32): The year.
  • month (Int32): The month (1-12).

Returns: CalendarWidget

A configured .

csharp
public static CalendarWidget Calendar<TParent>(this WidgetContext<TParent> ctx, int year, int month) where TParent : Hex1bWidget

Calendar<TParent>(WidgetContext<TParent>)

Creates a calendar widget displaying the current month.

Parameters:

  • ctx (WidgetContext<<TParent>>): The parent widget context.

Returns: CalendarWidget

A configured .

csharp
public static CalendarWidget Calendar<TParent>(this WidgetContext<TParent> ctx) where TParent : Hex1bWidget

Compact(CalendarWidget)

Enables compact mode (no gridlines). Ideal for embedding in a DatePicker.

Parameters:

Returns: CalendarWidget

csharp
public static CalendarWidget Compact(this CalendarWidget widget)

Day(CalendarWidget, Func<CalendarDayContext, Hex1bWidget?>)

Provides a callback to build custom content for each day cell. The callback receives a with information about the day and returns an optional widget rendered alongside the day number.

Parameters:

Returns: CalendarWidget

A configured .

csharp
public static CalendarWidget Day(this CalendarWidget widget, Func<CalendarDayContext, Hex1bWidget?> builder)

FirstDayOfWeek(CalendarWidget, DayOfWeek)

Sets the first day of the week for the calendar layout.

Parameters:

Returns: CalendarWidget

csharp
public static CalendarWidget FirstDayOfWeek(this CalendarWidget widget, DayOfWeek firstDay)

HighlightCurrent(CalendarWidget)

Enables highlighting of the current day with theme colors from and .

Parameters:

Returns: CalendarWidget

csharp
public static CalendarWidget HighlightCurrent(this CalendarWidget widget)

ShowHeader(CalendarWidget, bool)

Sets whether to display the day-of-week header row.

Parameters:

Returns: CalendarWidget

csharp
public static CalendarWidget ShowHeader(this CalendarWidget widget, bool show)

Today(CalendarWidget, DateOnly)

Sets the "today" date used for highlighting the current day.

Parameters:

Returns: CalendarWidget

csharp
public static CalendarWidget Today(this CalendarWidget widget, DateOnly today)

Released under the MIT License.