Class BufferTemplateContext<TValue>
Strongly-typed context data for the BufferTemplate.
Inherited Members
Namespace: Syncfusion.Blazor.Schedule
Assembly: Syncfusion.Blazor.Schedule.dll
Syntax
public class BufferTemplateContext<TValue>
Type Parameters
| Name | Description |
|---|---|
| TValue | The type of the underlying appointment model (e.g. |
Remarks
Use this generic variant inside your BufferTemplate RenderFragment to
access appointment properties without casting. The context argument of
the template can be cast to BufferTemplateContext<TValue>:
<BufferTemplate>
@{ var ctx = context as BufferTemplateContext<AppointmentData>; }
<div class="buffer-content">
@if (ctx?.IsBefore == true)
{
<span>@ctx.Duration mins</span>
}
else
{
<span>@ctx.Duration mins</span>
}
</div>
</BufferTemplate>
Constructors
BufferTemplateContext()
Declaration
public BufferTemplateContext()
Properties
Appointment
Gets the strongly-typed appointment that the buffer belongs to.
Declaration
public TValue Appointment { get; }
Property Value
| Type |
|---|
| TValue |
Duration
Gets the buffer duration in minutes.
Declaration
public int Duration { get; }
Property Value
| Type |
|---|
| int |
GroupIndex
Gets the group index of the resource row that contains the appointment.
Use this to call SfSchedule<TValue>.GetResourceByIndex(int) directly.
Declaration
public int GroupIndex { get; }
Property Value
| Type |
|---|
| int |
IsBefore
Gets a value indicating whether the buffer is rendered before (true)
or after (false) the appointment.
Declaration
public bool IsBefore { get; }
Property Value
| Type |
|---|
| bool |
Resource
Gets the resource row details (resource model, field mapping, ID, name) for
the resource that contains the appointment. Resolved via
SfSchedule<TValue>.GetResourceByIndex(GroupIndex).
Declaration
public ResourceDetails<TValue> Resource { get; }
Property Value
| Type |
|---|
| ResourceDetails<TValue> |
Remarks
null when the scheduler is not configured with resources or when the
appointment is not currently grouped under a resource row.
To access the underlying resource model from the template, cast
ctx.Resource.ResourceData to your resource model type, or use
ctx.Resource.GroupData for the ResourceDetails level:
@{ var room = (ctx.Resource?.ResourceData as Room); }
<span>Room: @room?.Name</span>