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
TThe 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
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
Editable
When true, empty slots are clickable to start creating a new event.
[Parameter]
public bool Editable { get; set; }
Property Value
EventContentTemplate
Optional custom rendering for an event's chip content.
[Parameter]
public RenderFragment<Schedule<T>>? EventContentTemplate { get; set; }
Property Value
JSRuntime
[Inject]
public IJSRuntime JSRuntime { get; set; }
Property Value
MaxHeight
The CSS max-height of the scrollable time grid - see MaxHeight.
[Parameter]
public string MaxHeight { get; set; }
Property Value
OnEventClick
Invoked with the event when one of its chips is activated.
[Parameter]
public EventCallback<Schedule<T>> OnEventClick { get; set; }
Property Value
OnEventDragEnd
Invoked when a drag ends, whether or not it was dropped on a valid target.
[Parameter]
public EventCallback OnEventDragEnd { get; set; }
Property Value
OnEventDragOver
Invoked with the start of the slot a dragged event is hovering. See OnEventDragOver.
[Parameter]
public EventCallback<DateTime> OnEventDragOver { get; set; }
Property Value
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
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
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
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
ScrollToTime
The time of day scrolled to when this view first mounts - see ScrollToTime.
[Parameter]
public TimeSpan ScrollToTime { get; set; }
Property Value
Methods
BuildRenderTree(RenderTreeBuilder)
Renders the component to the supplied RenderTreeBuilder.
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builderRenderTreeBuilder
DisposeAsync()
public ValueTask DisposeAsync()
Returns
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
firstRenderbool