Selecting Styles and Templates for VisualIntervals
In order to provide a fast and easy way for selecting appropriate styles and templates for VisualIntervals, the C1Scheduler control provides three classes: TimeSlotGroupStyleSelector, DayGroupStyleSelector, and TimeSlotTemplateSelector.
The TimeSlotGroupStyleSelector class provides a way to apply time slot group styles for working and free hours in Day View and Working Week View modes. To use it:
1. Create an instance of the class:
<local:TimeSlotGroupStyleSelector x:Key="TimeSlotGroupStyleSelector"/>
2. Define two group styles:
• with the key "PART_WorkHourStyle" for work hours;
• with the key "PART_FreeHourStyle" for free hours.
3. Specify a style selector in the group definition:
<GroupStyle ContainerStyleSelector="{StaticResource TimeSlotGroupStyleSelector}">
The DayGroupStylesSelector class provides a way to apply day group styles for an Office 2003/2007 look in Day View and Working Week View modes. To use it:
1. Create an instance of the class:
<local:DayGroupStyleSelector x:Key="DayGroupStyleSelector"/>
2. Define two group styles:
• with the key "PART_Day2003Style" for the Office 2003 look;
• with the key "PART_Day2007Style" for the Office 2007 look.
3. Specify a style selector in the group definition:
<GroupStyle ContainerStyleSelector="{StaticResource DayGroupStyleSelector}">
The TimeSlotTemplateSelector class provides a way to choose a DataTemplate for the VisualInterval object representing the single time slot in Day View and Working Week View modes. To use it:
1. Create an instance of the class:
<local:TimeSlotTemplateSelector x:Key="TimeSlotTemplateSelector"/>
2. Define two DataTemplates:
• with the key "PART_FreeSlotTemplate" for free time;
• with the key "PART_WorkSlotTemplate" for working time.
3. Specify an ItemTemplateSelector for the C1SchedulerPresenter object:
<local:C1SchedulerPresenter ItemTemplateSelector="{StaticResource TimeSlotTemplateSelector}" />
Note that if you use this method for choosing a VisualInterval DataTemplate, you shouldn't set the VisualIntervalTemplate property.
|