Table of Contents

Class TwCalendarWeekView<T>

Namespace
TwBlazor.Components
Assembly
TwBlazor.dll

Renders a Monday-Sunday week of TwCalendarDayColumn<T>s side by side, with a single shared hourly time-label gutter and a row of day headers (e.g. "Mon 16").

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

Type Parameters

T

The type of Value for the events shown.

Inheritance
TwCalendarWeekView<T>
Implements
Inherited Members

Constructors

TwCalendarWeekView()

public TwCalendarWeekView()

Properties

Date

Any date within the week to display - the week actually shown is the Monday-Sunday range containing it (see GetStartOfWeek(DateTime)).

[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; only the column for that day draws a placeholder.

[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>>

HighlightDate

A day whose column pulses, used to draw the eye to today after "Today" is pressed. Leave null for no highlight.

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

Property Value

DateTime?

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

OnDayHeaderClick

Invoked with a day's date when its header is clicked - typically wired up by TwCalendar<T> to switch to the Day view for that date.

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

Property Value

EventCallback<DateTime>

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. Which day it lands on falls naturally out of which column the drop happened in - see TwCalendarDayColumn<T>, which each column instance already scopes to its own Date - so this view doesn't need any extra cross-day logic.

[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 per day before being passed to each day's 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 - see the identical reasoning on OnAfterRenderAsync(bool).

protected override Task OnAfterRenderAsync(bool firstRender)

Parameters

firstRender bool

Returns

Task