Class TimeSlotViewSettings
Represents a class which is used to configure the properties related to time slots.
Inheritance
Implements
Inherited Members
Namespace: Syncfusion.UI.Xaml.Scheduler
Assembly: Syncfusion.Scheduler.WinUI.dll
Syntax
public abstract class TimeSlotViewSettings : ViewSettingsBase, IDisposable
Constructors
TimeSlotViewSettings()
Declaration
protected TimeSlotViewSettings()
Properties
CurrentTimeIndicatorStroke
Gets or sets a value indicating the foreground of current time indicator. The current time indicator color is only applied if the ShowCurrentTimeIndicator is enabled.
Declaration
public Brush CurrentTimeIndicatorStroke { get; set; }
Property Value
Type |
---|
Microsoft.UI.Xaml.Media.Brush |
Remarks
This property will be applicable to Day, Week, WorkWeek, TimelineDay, TimelineWeek and TimelineWorkWeek views.
DaysCount
Gets or sets the days count.
Declaration
public int DaysCount { get; set; }
Property Value
Type |
---|
System.Int32 |
Remarks
This property will be applicable to Day and TimelineDay views only.
EndHour
Gets or sets the EndHour.
Declaration
public double EndHour { get; set; }
Property Value
Type |
---|
System.Double |
Remarks
This property will be applicable to Day, Week, WorkWeek, TimelineDay, TimelineWeek and TimelineWorkWeek views.
MinimumAppointmentDuration
Gets or sets the minimum appointment duration.
Declaration
public TimeSpan MinimumAppointmentDuration { get; set; }
Property Value
Type |
---|
System.TimeSpan |
NonWorkingDays
Gets or sets the non working days.
Declaration
public ObservableCollection<DayOfWeek> NonWorkingDays { get; set; }
Property Value
Type |
---|
System.Collections.ObjectModel.ObservableCollection<System.DayOfWeek> |
Remarks
This property will be applicable to WorkWeek and TimelineWorkWeek views only.
ShowCurrentTimeIndicator
Gets or sets a value indicating whether the visibility of current time indicator.
Declaration
public bool ShowCurrentTimeIndicator { get; set; }
Property Value
Type |
---|
System.Boolean |
Remarks
This property will be applicable to Day, Week, WorkWeek, TimelineDay, TimelineWeek and TimelineWorkWeek views.
SpecialTimeRegions
Gets or sets the special time regions of the schedule which is used to customize the TimeSlots of day, week, work week and Timeline views.
Declaration
public ObservableCollection<SpecialTimeRegion> SpecialTimeRegions { get; set; }
Property Value
Type |
---|
System.Collections.ObjectModel.ObservableCollection<SpecialTimeRegion> |
Remarks
This property will be applicable to Day, Week, WorkWeek, TimelineDay, TimelineWeek and TimelineWorkWeek views.
Examples
The following sample used to configure the special time regions.
# [C#](#tab/tabid-d)this.schedule.DaysViewSettings.SpecialTimeRegions = GetSpecialRegions();
this.schedule.TimelineViewSettings.SpecialTimeRegions = GetSpecialRegions();
private ObservableCollection<SpecialTimeRegion> GetSpecialRegions()
{
var currentDate = DateTime.Now.AddMonths(-3);
var nonWorkingHours1 = new SpecialTimeRegion();
nonWorkingHours1.StartTime = new DateTime(currentDate.Year, currentDate.Month, 1, 0, 0, 0);
nonWorkingHours1.EndTime = nonWorkingHours1.StartTime.AddHours(8);
nonWorkingHours1.Background = new SolidColorBrush(Color.FromArgb(255, 245, 245, 245));
nonWorkingHours1.RecurrenceRule = "FREQ=DAILY;INTERVAL=1";
nonWorkingHours1.ResourceIdCollection = new ObservableCollection<object>() { "0", "1", "2", "3", "4", "5", "6" };
var nonWorkingHours2 = new SpecialTimeRegion();
nonWorkingHours2.StartTime = new DateTime(currentDate.Year, currentDate.Month, 1, 13, 0, 0);
nonWorkingHours2.EndTime = nonWorkingHours2.StartTime.AddHours(1);
nonWorkingHours2.Background = new SolidColorBrush(Color.FromArgb(255, 245, 245, 245));
nonWorkingHours2.RecurrenceRule = "FREQ=DAILY;INTERVAL=1";
nonWorkingHours2.ResourceIdCollection = new ObservableCollection<object>() { "0", "1", "2", "3", "4", "5", "6" };
nonWorkingHours2.CanMergeAdjacentRegions = true;
nonWorkingHours2.CanEdit = false;
var specialTimeRegions = new ObservableCollection<SpecialTimeRegion>();
specialTimeRegions.Add(nonWorkingHours1);
specialTimeRegions.Add(nonWorkingHours2);
return specialTimeRegions;
}
***
SpecialTimeRegionTemplate
Gets or sets the special time region template to customize the default UI with custom UI in schedule.
Declaration
public DataTemplate SpecialTimeRegionTemplate { get; set; }
Property Value
Type |
---|
Microsoft.UI.Xaml.DataTemplate |
Examples
The following sample used to configure the special time region template.
# [Xaml](#tab/tabid-e)<syncfusion:SfScheduler x:Name="Schedule">
<syncfusion:SfScheduler.DaysViewSettings>
<syncfusion:DaysViewSettings>
<syncfusion:DaysViewSettings.SpecialTimeRegionTemplate>
<DataTemplate >
<Grid Background = "{Binding Background}" Opacity="0.5"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
</Grid>
</DataTemplate>
</syncfusion:DaysViewSettings.SpecialTimeRegionTemplate>
</syncfusion:DaysViewSettings>
</syncfusion:SfScheduler.DaysViewSettings>
<syncfusion:SfScheduler.TimelineViewSettings>
<syncfusion:TimelineViewSettings>
<syncfusion:TimelineViewSettings.SpecialTimeRegionTemplate>
<DataTemplate >
<Grid Background = "{Binding Background}" Opacity="0.5"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
</Grid>
</DataTemplate>
</syncfusion:TimelineViewSettings.SpecialTimeRegionTemplate>
</syncfusion:TimelineViewSettings>
</syncfusion:SfScheduler.TimelineViewSettings>
</syncfusion:SfScheduler>
***
SpecialTimeRegionTemplateSelector
Gets or sets the special time region template selector to customize the default UI with custom UI in schedule.
Declaration
public DataTemplateSelector SpecialTimeRegionTemplateSelector { get; set; }
Property Value
Type |
---|
Microsoft.UI.Xaml.Controls.DataTemplateSelector |
Examples
The following sample used to configure the special time region template selector.
# [DataTemplateSelector.cs](#tab/tabid-f)public class SpecialTimeRegionTemplateSelector : DataTemplateSelector
{
public SpecialTimeRegionTemplateSelector()
{
}
public DataTemplate SpecialRegionTemplate1 { get; set; }
public DataTemplate SpecialRegionTemplate2 { get; set; }
protected override DataTemplate SelectTemplateCore(object item, DependencyObject container)
{
if (item is SpecialTimeRegion)
{
if (!(item as SpecialTimeRegion).CanEdit)
return SpecialRegionTemplate2;
}
return SpecialRegionTemplate1;
}
}
# [MainWindow](#tab/tabid-g)
<Window.Resources>
<DataTemplate x:Key="specialRegionTemplate1">
<Grid Background = "{Binding Background}" Opacity="0.5"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
</Grid>
</DataTemplate>
<DataTemplate x:Key="specialRegionTemplate2">
<Grid Background = "{Binding Background}" Opacity="0.5"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Image x:Name="Image" HorizontalAlignment="Center"
VerticalAlignment="Center" Source="/Assets/Scheduler/Fork.png"/>
</Grid>
</DataTemplate>
<local:SpecialTimeRegionTemplateSelector x:Key="specialTimeRegionTemplateSelector"
SpecialRegionTemplate1="{StaticResource specialRegionTemplate1}"
SpecialRegionTemplate2="{StaticResource specialRegionTemplate2}" />
</Window.Resources>
<syncfusion:SfScheduler x:Name="schedule">
<syncfusion:SfScheduler.DaysViewSettings>
<syncfusion:DaysViewSettings SpecialTimeRegionTemplateSelector = "{StaticResource specialTimeRegionTemplateSelector}" />
</ syncfusion:SfScheduler.DaysViewSettings>
<syncfusion:SfScheduler.TimelineViewSettings>
<syncfusion:TimelineViewSettings SpecialTimeRegionTemplateSelector = "{StaticResource specialTimeRegionTemplateSelector}" />
</ syncfusion:SfScheduler.TimelineViewSettings>
</syncfusion:SfScheduler>
StartHour
Gets or sets the StartHour.
Declaration
public double StartHour { get; set; }
Property Value
Type |
---|
System.Double |
Remarks
This property will be applicable to Day, Week, WorkWeek, TimelineDay, TimelineWeek and TimelineWorkWeek views.
TimeInterval
Gets or sets a time interval.
Declaration
public TimeSpan TimeInterval { get; set; }
Property Value
Type |
---|
System.TimeSpan |
Remarks
This property will be applicable to Day, Week, WorkWeek, TimelineDay, TimelineWeek and TimelineWorkWeek views.
TimeIntervalSize
Gets or sets a time interval size.
Declaration
public double TimeIntervalSize { get; set; }
Property Value
Type |
---|
System.Double |
TimeRulerCellTemplate
Gets or sets the time ruler cell template.
Declaration
public DataTemplate TimeRulerCellTemplate { get; set; }
Property Value
Type |
---|
Microsoft.UI.Xaml.DataTemplate |
Remarks
This property will be applicable to Day, Week, WorkWeek, TimelineDay, TimelineWeek and TimelineWorkWeek views.
Examples
<syncfusion:SfScheduler x:Name="Schedule">
<syncfusion:SfScheduler.DaysViewSettings>
<syncfusion:DaysViewSettings>
<syncfusion:DaysViewSettings.TimeRulerCellTemplate>
<DataTemplate>
<TextBlock Foreground = "Red" FontSize="10" Text="{Binding}"/>
</DataTemplate>
</syncfusion:DaysViewSettings.TimeRulerCellTemplate>
</syncfusion:DaysViewSettings>
</syncfusion:SfScheduler.DaysViewSettings>
<syncfusion:SfScheduler.TimelineViewSettings>
<syncfusion:TimelineViewSettings>
<syncfusion:TimelineViewSettings.TimeRulerCellTemplate>
<DataTemplate>
<TextBlock Foreground = "Red" FontSize="10" Text="{Binding}"/>
</DataTemplate>
</syncfusion:TimelineViewSettings.TimeRulerCellTemplate>
</syncfusion:TimelineViewSettings>
</syncfusion:SfScheduler.TimelineViewSettings>
</syncfusion:SfScheduler>
TimeRulerFormat
Gets or sets a time format.
Declaration
public string TimeRulerFormat { get; set; }
Property Value
Type |
---|
System.String |
Remarks
This property will be applicable to Day, Week, WorkWeek, TimelineDay, TimelineWeek and TimelineWorkWeek views.
Examples
this.Schedule.DaysViewSettings.TimeRulerFormat = "h tt";
this.Schedule.TimelineViewSettings.TimeRulerFormat = "h tt";
TimeRulerSize
Gets or sets the time label layout width.
Declaration
public double TimeRulerSize { get; set; }
Property Value
Type |
---|
System.Double |
Remarks
This property will be applicable to Day, Week, WorkWeek, TimelineDay, TimelineWeek and TimelineWorkWeek views.
ViewHeaderDateFormat
Gets or sets a view header date format.
Declaration
public string ViewHeaderDateFormat { get; set; }
Property Value
Type |
---|
System.String |
Examples
this.Schedule.DaysViewSettings.ViewHeaderDateFormat = "%d";
this.Schedule.TimelineViewSettings.ViewHeaderDateFormat = "%d";
Methods
Dispose(Boolean)
Disposes all the resources used by the TimeSlotViewSettings class.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | Indicates whether the call is from Dispose method or from a System.GC.SuppressFinalize(System.Object). |