Using the C1Calendar Control > Settings |
The C1Scheduler and C1Calendar controls share the same set of calendar settings. These settings are accessible via the corresponding properties of the CalendarHelper class. For example, you can create a work week calendar by specifying the work days through the CalendarHelper class. Notice that the XAML for the CalendarHelper class is the same for all three controls.
XAML for C1Scheduler
XAML |
Copy Code
|
---|---|
<my:C1Scheduler x:Name="scheduler1"> <my:C1Scheduler.CalendarHelper> <my:CalendarHelper Culture="English " WeekStart="Sunday" EndDayTime="18:20:00" StartDayTime="09:20:00" WorkDays="Tuesday,Wednesday,Thursday,Friday,Saturday"> </my:CalendarHelper> </my:C1Scheduler.CalendarHelper> </my:C1Scheduler> |
XAML for C1Calendar
XAML |
Copy Code
|
---|---|
<my:C1Calendar x:Name="scheduler1"> <my:C1MonthCalendar.CalendarHelper> <my:CalendarHelper Culture="English " WeekStart="Sunday" EndDayTime="18:20:00" StartDayTime="09:20:00" WorkDays="Tuesday,Wednesday,Thursday,Friday,Saturday"> </my:CalendarHelper> </my:C1MonthCalendar.CalendarHelper> </my:C1MonthCalendar> |
You can set C1Scheduler.CalendarHelper properties for one control and use them in several controls. This can be done by binding the C1Scheduler.CalendarHelper properties of corresponding controls to each other. For example, suppose you have a C1Scheduler control with the previously specified C1Scheduler.CalendarHelper properties and a C1Calendar control with no properties specified yet in your window. Set the C1Calendar C1Scheduler.CalendarHelper properties as in the following XAML:
XAML |
Copy Code
|
---|---|
<my:C1Calendar Name="calendar1" CalendarHelper="{Binding ElementName=scheduler1, Path=CalendarHelper, Mode=OneWay}"/> |
The C1Calendar will display all of the C1Scheduler.CalendarHelper properties specified for the C1Scheduler control.
The following calendar settings are available:
CalendarHelper Property |
Description |
Culture |
Gets or sets the CultureInfo object which holds culture-specific information. |
Gets or sets the DayOfWeek value determining the first day of the week. The default is system settings. |
|
Gets or sets the WorkDays object containing the set of working days in one week. |
|
Gets or sets the TimeSpan value specifying the beginning of the working time. |
|
Gets or sets the TimeSpan value specifying the end of the working time. |
|
Gets or sets ObservableCollection<DateTime> object which holds the list of holidays (non-working days in addition to weekends). |
|
Gets or sets the ObservableCollection<DateTime> object which holds the list of weekend days which should be working. |
|
Gets an array of culture specific full month names. |