Class SchedulerDaysView
Represents a class which is used to configure all the properties of day, week and workweek views of the SfScheduler.
Inherited Members
Namespace: Syncfusion.Maui.Scheduler
Assembly: Syncfusion.Maui.Scheduler.dll
Syntax
public class SchedulerDaysView : SchedulerTimeSlotView, IThemeElement
Constructors
SchedulerDaysView()
Initializes a new instance of the SchedulerDaysView class.
Declaration
public SchedulerDaysView()
Fields
AllDayAppointmentTemplateProperty
Identifies the AllDayAppointmentTemplate dependency property.
Declaration
public static readonly BindableProperty AllDayAppointmentTemplateProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for AllDayAppointmentTemplate dependency property. |
MoreAppointmentsTemplateProperty
Identifies the MoreAppointmentsTemplateProperty dependency property.
Declaration
public static readonly BindableProperty MoreAppointmentsTemplateProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for MoreAppointmentsTemplateProperty dependency property. |
TimeIntervalHeightProperty
Identifies the TimeIntervalHeight dependency property.
Declaration
public static readonly BindableProperty TimeIntervalHeightProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for TimeIntervalHeight dependency property. |
TimeRulerWidthProperty
Identifies the TimeRulerWidth dependency property.
Declaration
public static readonly BindableProperty TimeRulerWidthProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for TimeRulerWidth dependency property. |
Properties
AllDayAppointmentTemplate
Gets or sets the all day appointment template to customize the default UI.
Declaration
public DataTemplate AllDayAppointmentTemplate { get; set; }
Property Value
Type |
---|
Microsoft.Maui.Controls.DataTemplate |
Remarks
By default, the SchedulerAppointment is set as the BindingContext
for AllDayAppointmentTemplate for both SchedulerAppointment and custom data object in AppointmentsSource.
Custom data object can be bound in AllDayAppointmentTemplate by using DataItem.
Examples
The following sample used to configure the custom appointments and appointment template.
# [Model.cs](#tab/tabid-5)public class Meeting
{
public string EventName { get; set; }
public DateTime From { get; set; }
public DateTime To { get; set; }
public Brush BackgroundBrush { get; set; }
public string RecurrenceRule { get; set; }
public bool IsAllDay { get; set; }
}
# [C#](#tab/tabid-6)
var customAppointments = new ObservableCollection<Meeting>();
var meeting = new Meeting()
{
EventName = "General Meeting",
From = new DateTime(2022, 2, 25, 09, 0, 0),
To = new DateTime(2022, 2, 25, 10, 0, 0),
BackgroundBrush = Brush.GreenYellow,
IsAllDay = true,
};
customAppointments.Add(meeting);
this.scheduler.AppointmentsSource = customAppointments;
# [XAML](#tab/tabid-7)
<ContentPage.Resources>
<DataTemplate x:Key="allDayAppointmentTemplate">
<Grid Background="{Binding DataItem.BackgroundBrush}">
<Label Text="{Binding DataItem.EventName}" TextColor="Black"/>
</Grid>
</DataTemplate>
</ContentPage.Resources>
<syncfusion:SfScheduler x:Name="scheduler">
<syncfusion:SfScheduler.DaysView>
<syncfusion:SchedulerDaysView AllDayAppointmentTemplate="{StaticResource allDayAppointmentTemplate}"/>
</syncfusion:SfScheduler.DaysView>
<syncfusion:SfScheduler.AppointmentMapping>
<syncfusion:SchedulerAppointmentMapping
Subject="EventName"
StartTime="From"
EndTime="To"
IsAllDay="IsAllDay"
Background="BackgroundBrush"/>
</syncfusion:SfScheduler.AppointmentMapping>
</syncfusion:SfScheduler>
MoreAppointmentsTemplate
Gets or sets the all day more appointments template to customize the default UI.
Declaration
public DataTemplate MoreAppointmentsTemplate { get; set; }
Property Value
Type |
---|
Microsoft.Maui.Controls.DataTemplate |
Remarks
The BindingContext of the MoreAppointmentsTemplate is expandable more appointments count value in the all day layout. The MoreAppointmentsTemplate does not support data template selector.
Examples
The following sample used to configure the more appointments template.
#[C#](#tab/tabid-8)var schedulerAppointments = new ObservableCollection<SchedulerAppointment>()
for (int i = 0; i < 5; i++)
{
var schedulerAppointment = new SchedulerAppointment()
{
Subject = "General Meeting",
StartTime = new DateTime(2022, 04, 30, 09, 0, 0),
EndTime = new DateTime(2022, 04, 30, 10, 0, 0),
Background = Brush.GreenYellow,
IsAllDay = true,
};
schedulerAppointments.Add(schedulerAppointment);
}
this.Scheduler.AppointmentsSource = schedulerAppointments;
# [XAML](#tab/tabid-9)
<syncfusion:SfScheduler x:Name="Scheduler">
<syncfusion:SfScheduler.DaysView>
<syncfusion:SchedulerDaysView>
<syncfusion:SchedulerDaysView.MoreAppointmentsTemplate>
<DataTemplate>
<Grid Background="LightBlue" Margin="1">
<Label Text="{Binding StringFormat=+{0}}" TextColor="Black"/>
</Grid>
</DataTemplate>
</syncfusion:SchedulerDaysView.MoreAppointmentsTemplate>
</syncfusion:SchedulerDaysView>
</syncfusion:SfScheduler.DaysView>
</syncfusion:SfScheduler>
TimeIntervalHeight
Gets or sets the height for each time slot cell to layout within this in day, week, and work week views of the SfScheduler.
Declaration
public double TimeIntervalHeight { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The default value is 50 used to specify the time interval height for day, week and workweek views. |
Remarks
The time interval height can be adjusted based on screen height by changing the value of this property to -1. It will auto-fit to the screen height and width.
Examples
The below examples shows, how to use the TimeIntervalHeight property of SchedulerDaysView in the SfScheduler.
<schedule:SfScheduler x:Name="Scheduler"
View="Week">
<schedule:SfScheduler.DaysView>
<schedule:SchedulerDaysView TimeIntervalHeight = "120" />
</ schedule:SfScheduler.DaysView>
</schedule:SfScheduler>
See Also
TimeRulerWidth
Gets or sets the width for the time ruler view to layout within this in day, week, and work week views of the SfScheduler.
Declaration
public double TimeRulerWidth { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The default value is 60 used to specify the time ruler width for day, week and workweek views. |
Remarks
Examples
The below examples shows, how to use the TimeRulerWidth property of SchedulerDaysView in the SfScheduler.
<schedule:SfScheduler x:Name="Scheduler"
View="Week">
<schedule:SfScheduler.DaysView>
<schedule:SchedulerDaysView TimeRulerWidth = "120" />
</ schedule:SfScheduler.DaysView>
</schedule:SfScheduler>