Table of Contents

Class TwCalendarDayView<T>

Namespace
TwBlazor.Components
Assembly
TwBlazor.dll

Renders a single day's time-slot grid (via TwCalendarDayColumn<T>) with an hourly time-label gutter on the left, under an all-day strip (TwCalendarAllDayRow<T>).

public class TwCalendarDayView<T> : TwBlazorComponentBase, IComponent, IHandleEvent, IHandleAfterRender, ITwComponent, IAsyncDisposable

Type Parameters

T

The type of Value for the events shown.

Inheritance
TwCalendarDayView<T>
Implements
Inherited Members

Constructors

TwCalendarDayView()

public TwCalendarDayView()

Properties

Date

The day being displayed.

[Parameter]
[EditorRequired]
public DateTime Date { get; set; }

Property Value

DateTime

DraggedEvent

The event being dragged once the drag is live; see DraggedEvent.

[Parameter]
public Schedule<T>? DraggedEvent { get; set; }

Property Value

Schedule<T>

DropPreview

Where DraggedEvent would land if released now.

[Parameter]
public DateTime? DropPreview { get; set; }

Property Value

DateTime?

Editable

When true, empty slots are clickable to start creating a new event.

[Parameter]
public bool Editable { get; set; }

Property Value

bool

EventContentTemplate

Optional custom rendering for an event's chip content.

[Parameter]
public RenderFragment<Schedule<T>>? EventContentTemplate { get; set; }

Property Value

RenderFragment<Schedule<T>>

JSRuntime

[Inject]
public IJSRuntime JSRuntime { get; set; }

Property Value

IJSRuntime

MaxHeight

The CSS max-height of the scrollable time grid - see MaxHeight.

[Parameter]
public string MaxHeight { get; set; }

Property Value

string

OnEventClick

Invoked with the event when one of its chips is activated.

[Parameter]
public EventCallback<Schedule<T>> OnEventClick { get; set; }

Property Value

EventCallback<Schedule<T>>

OnEventDragEnd

Invoked when a drag ends, whether or not it was dropped on a valid target.

[Parameter]
public EventCallback OnEventDragEnd { get; set; }

Property Value

EventCallback

OnEventDragOver

Invoked with the start of the slot a dragged event is hovering. See OnEventDragOver.

[Parameter]
public EventCallback<DateTime> OnEventDragOver { get; set; }

Property Value

EventCallback<DateTime>

OnEventDragStart

Invoked with an event when dragging it starts. See TwCalendar<T>'s OnEventDragStart/OnEventDrop remarks.

[Parameter]
public EventCallback<Schedule<T>> OnEventDragStart { get; set; }

Property Value

EventCallback<Schedule<T>>

OnEventDrop

Invoked with a slot's start date/time when a dragged event is dropped there.

[Parameter]
public EventCallback<DateTime> OnEventDrop { get; set; }

Property Value

EventCallback<DateTime>

OnSlotClick

Invoked with the clicked slot's start date/time when an empty slot is activated while Editable.

[Parameter]
public EventCallback<DateTime> OnSlotClick { get; set; }

Property Value

EventCallback<DateTime>

Schedules

The full event list; filtered down to Date before being passed to the underlying TwCalendarDayColumn<T>.

[Parameter]
public List<Schedule<T>> Schedules { get; set; }

Property Value

List<Schedule<T>>

ScrollToTime

The time of day scrolled to when this view first mounts - see ScrollToTime.

[Parameter]
public TimeSpan ScrollToTime { get; set; }

Property Value

TimeSpan

Methods

BuildRenderTree(RenderTreeBuilder)

Renders the component to the supplied RenderTreeBuilder.

protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder RenderTreeBuilder

DisposeAsync()

public ValueTask DisposeAsync()

Returns

ValueTask

OnAfterRenderAsync(bool)

Scrolls to ScrollToTime once, the first time this view mounts - not on every render, so a user's own subsequent scrolling (or navigating between dates without leaving the Day view) is never fought.

protected override Task OnAfterRenderAsync(bool firstRender)

Parameters

firstRender bool

Returns

Task