Class TwDatePickerDayView
- Namespace
- TwBlazor.Components.DatePicker
- Assembly
- TwBlazor.dll
public class TwDatePickerDayView : TwBlazorComponentBase, IComponent, IHandleEvent, IHandleAfterRender, ITwComponent, IAsyncDisposable
- Inheritance
-
TwDatePickerDayView
- Implements
- Inherited Members
Constructors
TwDatePickerDayView()
public TwDatePickerDayView()
Properties
JSRuntime
[Inject]
public IJSRuntime JSRuntime { get; set; }
Property Value
MaxDate
The latest selectable date (inclusive, date-only comparison). Days after this render disabled. null (the default) leaves the upper bound unrestricted.
[Parameter]
public DateTime? MaxDate { get; set; }
Property Value
MinDate
The earliest selectable date (inclusive, date-only comparison). Days before this render disabled. null (the default) leaves the lower bound unrestricted.
[Parameter]
public DateTime? MinDate { get; set; }
Property Value
Range
When set, switches the grid from single-day selection to range highlighting: days matching
Key (start) / Value (end) render as range endpoints and days strictly between
them render with RangeClass. Left null
(the default) for TwDatePicker's single-date rendering;
set by TwDateRangePicker - the outer Nullable<T>
distinguishes "not in range mode at all" (null) from "range mode, nothing
picked yet" (a value whose Key/Value are both themselves null).
[Parameter]
public KeyValuePair<DateTime?, DateTime?>? Range { get; set; }
Property Value
- KeyValuePair<DateTime?, DateTime?>?
SelectedDate
The actually-selected date in single-select mode (Range not set), used only to decide which day cell (if any within the currently displayed month) renders as selected. null (the default) means nothing is selected, and is also what TwDateRangePicker leaves it as, since range mode drives its own highlighting entirely from Range instead.
[Parameter]
public DateTime? SelectedDate { get; set; }
Property Value
ShowMonthCaption
When true, renders a "Month Year" caption above the grid using RangeMonthCaptionClass. Used by TwDateRangePicker, which shows two of these grids side by side and needs each to label its own month since a shared outer header only shows one title.
[Parameter]
public bool ShowMonthCaption { get; set; }
Property Value
Value
The month this grid displays (only Year/Month matter for that; Day is
otherwise unused). Purely a display/navigation anchor - independent of which day, if any,
is actually selected (see SelectedDate), since a caller can browse to a
different month than the one containing its real selection without changing that selection.
[Parameter]
public DateTime Value { get; set; }
Property Value
ValueChanged
[Parameter]
public EventCallback<DateTime> ValueChanged { get; set; }
Property Value
Methods
BuildRenderTree(RenderTreeBuilder)
Renders the component to the supplied RenderTreeBuilder.
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builderRenderTreeBuilder
DisposeAsync()
Unregisters the JS-side keydown guard registered for this grid.
public ValueTask DisposeAsync()
Returns
OnAfterRenderAsync(bool)
Registers the same generic keydown guard TwTabContainer uses for its tablist, so ArrowUp/ArrowDown/ArrowLeft/ArrowRight/Home/End don't also scroll the page while navigating the day grid, without ever touching Tab's default behavior.
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters
firstRenderbool
Returns
OnParametersSet()
Invoked when the component's parameters have been set. Ensures that the component has a unique identifier by generating one if none is provided.
protected override void OnParametersSet()
Remarks
If the component's identifier is not set, a unique ID is generated based on the component's type name (with a 'Tw' prefix removed if present) and a GUID. This helps ensure that each component instance can be uniquely identified, which is useful for scenarios such as associating labels with form elements or targeting elements in client-side scripts.