ComponentOne Scheduler for WPF: Using Scheduler for WPF > Scheduler for WPF Appearance > Using Data Views

Using Data Views

Scheduler for WPF provides four views to display data in the DataStorage.

 

Data View

Description

One Day View

Displays a detailed view showing appointments for a particular day.

Month View

Displays appointments for one or more months. This is the default view.

Week View

Displays appointments for specified week days.

Working Week View

Displays appointments for any given weekly period. The default is Monday through Friday.

 

Each view is represented by a single style, each of which is fully defined in XAML. These predefined styles can be applied to C1Scheduler and are accessible via the static fields of the C1SchedulerResources class, including: OneDayStyle, WorkingWeekStyle, WeekStyle, and MonthStyle. The default view of the interface is MonthStyle, and the current date is shown.

To specify a view, Day View for example, assign scheduler's ChangeStyle method using the OneDayStyle field value:

      Visual Basic

Scheduler1.ChangeStyle(C1SchedulerResources.OneDayStyle)

      C#

Scheduler1.ChangeStyle(C1SchedulerResources.OneDayStyle);

      XAML

<c1sched:C1Scheduler Style="{DynamicResource {ComponentResourceKey TypeInTargetAssembly=c1sched:C1Scheduler, ResourceId=OneDayStyle}}"/>

The data view can be set at design time in Visual Studio using the context menu:

1.   Right-click the C1Scheduler control.

2.   Select View and choose One Day, Work Week, Week, or Month.

Note: You can also change the view through the Properties window by selecting the option from the drop-down list next to the Style property.

The style can also be set in the Design view of Microsoft Blend. To change the visual Style in a Microsoft Blend project:

1.   Select the C1Scheduler control in your XAML window or page.

2.   In the Properties panel, under View, click drop-down arrow next to the C1Scheduler.Style property.

3.   Select one of the available view styles.

 

 

These properties are used by C1Scheduler to automatically change the styles used if the range of visible dates is changed by the associated calendar control or if the range of visible dates and/or view type is changed by a C1Scheduler command. The user can alter the default behavior by handling the BeforeViewChange event or by setting the C1Scheduler ViewStyleSelector property to the custom StyleSelector object.

By default, these styles are set to styles defined in the default C1Scheduler theme ResourceDictionary. When the Theme property is changed, the control looks for a predefined set of ComponentResourceKeys. If a ComponentResourceKey is found in the new theme resource dictionary, then the corresponding style gets updated with the new one.

To change the whole style set used by C1Scheduler, set the style properties to custom defined styles. For example:

// set C1Scheduler’s styles to a custom look.

scheduler1.OneDayStyle = customOneDayStyle;

scheduler1.WorkingWeekStyle = customWorkingWeekStyle;

scheduler1.WeekStyle = customWeekStyle;

scheduler1.MonthStyle = customMonthStyle;


Data View Keys and Appearance

C1Scheduler Default Styles and Templates


Send comments about this topic to ComponentOne.
Copyright © 1987-2010 ComponentOne LLC. All rights reserved.