Scheduler for WPF and Silverlight | ComponentOne
Scheduler Components and Controls / Scheduler for Silverlight Appearance / Selecting Styles and Templates for VisualIntervals
In This Topic
    Selecting Styles and Templates for VisualIntervals
    In This Topic

    In order to provide a fast and easy way for selecting appropriate styles and templates for C1Scheduler.VisualIntervals, the C1Scheduler control provides five classes: TimeSlotGroupStyleSelectorDayGroupStyleSelectorTimeSlotTemplateSelectorDayIntervalStyleSelector and TimeSlotStyleSelector.

    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 in the TimeSlotGroupStyleSelector resources:
      • 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 in the DayGroupStylesSelector resources:
      • 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 in the TimeSlotTemplateSelector resources:
      • 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 C1Scheduler.VisualIntervalTemplate property.

    The DayIntervalStyleSelector class provides a way to apply day group styles for ordinal/current days. To use it:

    1. Create an instance of the class:
      <local:DayIntervalStyleSelector x:Key=”DayIntervalStyleSelector"/>
      
    2. Define two group styles in the DayIntervalStyleSelector resources:
      • with the key "C1Scheduler_Day_Style" for ordinal days;
      • with the key "C1Scheduler_Today_Style" the current date.
    3. Specify a style selector in the group definition:
      <GroupStyle ContainerStyleSelector="{StaticResource DayIntervalStyleSelector}">
      

    The TimeSlotStyleSelector class provides a way to apply time slot 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:TimeSlotStyleSelector x:Key="TimeSlotStyleSelector"/>
    2. Define two group styles in the TimeSlotStyleSelector resources:
      • with the key "C1Scheduler_WorkSlot_Style" for work hours;
      • with the key "C1Scheduler_FreeSlot_Style" for free hours.
    3. Specify an ItemContainerStyleSelector for the C1SchedulerPresenter object:
      <local:C1SchedulerPresenter ItemContainerStyleSelector="{StaticResource TimeSlotTemplateSelector}" />