ClassSlot
Represents a specific time range in the scheduler that can be used for appointments, special slots, or time-based operations. Slots define contiguous time periods and can support recurrence patterns for repeating time blocks.
Definition
Namespace:Telerik.Maui.Controls.Scheduler
Assembly:Telerik.Maui.Controls.dll
Syntax:
public class Slot : DateRange, INotifyPropertyChanged, IDateRange, ICopyable<Slot>
Inheritance: objectNotifyPropertyChangedBaseDateRangeSlot
Implements:
Inherited Members
Constructors
Slot()
Initializes a new instance of the Slot class with default values. The default constructor creates an empty slot with the current local time zone.
Declaration
public Slot()
Remarks
After using this constructor, you should set the Start and End properties to define the actual time range for the slot. The TimeZone is automatically set to the system's local time zone for consistency with user expectations.
Slot(DateTime, DateTime)
Initializes a new instance of the Slot class with the specified start and end times. This constructor provides a convenient way to create a slot with explicit time boundaries.
Declaration
public Slot(DateTime start, DateTime end)
Parameters
start
The start date and time for the slot.
end
The end date and time for the slot. Must be greater than or equal to start.
Remarks
This constructor is ideal for creating slots with known time ranges. The TimeZone is automatically set to the system's local time zone. If you need a different time zone, set the TimeZone property after construction.
Slot(IDateRange)
Initializes a new instance of the Slot class.
Declaration
public Slot(IDateRange other)
Parameters
other
A DateSpan instance that is used for initializing the new instance.
Slot(Slot)
Initializes a new instance of the Slot class.
Declaration
public Slot(Slot other)
Parameters
other
Another slot that is used for initializing the new instance.
Properties
IsReadOnly
Gets or sets a value indicating whether this slot is read-only and cannot be modified by user interactions. Read-only slots are typically used for system-defined time periods or protected time ranges.
Declaration
public bool IsReadOnly { get; set; }
Property Value
True if the slot is read-only and should not allow modifications; otherwise, false.
Remarks
Read-only slots serve various purposes in scheduling applications:
- System-defined breaks or maintenance windows
- Protected time periods that users cannot override
- Holiday or special occasion time blocks
- Time slots reserved by administrators
- Unavailable time periods for resource scheduling
When a slot is marked as read-only:
- Users cannot create appointments in this time range
- The slot may be displayed with different visual styling
Read-only status is typically enforced by the UI and business logic layers, rather than being a technical constraint of the slot itself.
RecurrencePattern
Gets or sets the recurrence pattern that defines how this slot repeats over time. When set, this slot becomes a template for generating recurring slot instances.
Declaration
public RecurrencePattern RecurrencePattern { get; set; }
Property Value
A RecurrencePattern object defining the repetition rules, or null for non-recurring slots.
Remarks
Recurrence patterns enable slots to repeat according to various schedules:
- Daily patterns: Every day, weekdays only, every N days
- Weekly patterns: Specific days of the week, every N weeks
- Monthly patterns: Same date each month, specific weekday patterns
- Custom patterns: Complex repetition rules
Common use cases for recurring slots:
- Regular break times or lunch hours
- Recurring meeting slots or reserved times
- Maintenance windows or system unavailability
- Office hours or availability periods
When a recurrence pattern is applied, the scheduler can generate multiple slot instances based on the pattern rules and display them across the appropriate time periods.
TimeZone
Gets or sets the time zone information for this slot. This property ensures proper time zone handling for slots that may be used across different time zones.
Declaration
public TimeZoneInfo TimeZone { get; set; }
Property Value
A TimeZoneInfo object representing the slot's time zone. Defaults to the system's local time zone.
Remarks
Time zone support is important for:
- Applications used across multiple time zones
- Accurate slot display regardless of user location
The Start and End times should be interpreted in the context of this TimeZone. When displaying slots to users, the times may be converted to the user's local time zone for clarity.
For recurring slots, the time zone affects how recurrence instances are calculated, especially during daylight saving time transitions.
Methods
Copy()
Copies this instance.
CopyFrom(Slot)
Deep copies all properties from other
to this Slot.
Equals(object)
Determines whether the specified object is equal to this instance.