This is a migrated thread and some comments may be shown as answers.

AppointmentItem DataContext

1 Answer 86 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Nico
Top achievements
Rank 1
Nico asked on 02 Aug 2011, 01:03 PM
Hey Telerik,

I'd like to have a reference to the resource column the AppointmentItem is shown in.
This is very useful to change the styling of the appointment based on the column it is shown in.
Since now there is only a reference to the Appointment ViewModel this is not possible.

In my current solution I add a "Resource" dependency property to the Appointment Data Context Proxy, and use reflection on the
groupheader's (GroupKey is the resource) AppointmentItems to set the extra property. However this is done in the a derivative class of the AppointmentsPanel and during it's arrangeoverride, needles to say it degrades performance.

Any suggestions?

Greetz,
Nico

1 Answer, 1 is accepted

Sort by
0
Valeri Hristov
Telerik team
answered on 04 Aug 2011, 03:20 PM
Hello Nico,

The columns are uniquely identified by their corresponding resources (and dates), for example in this demo (it is Silverlight, but WPF is the same):
http://demos.telerik.com/silverlight/#ScheduleView/Grouping/Basics
the left ScheduleView - the first column has resources Business Layer, 200 and some date; the second column has Business Layer, 250 and some date, etc. If an appointment is going to be rendered in this column, it will have exactly the same resources. So using the resources of the appointment you could match the correct styling using a AppointmentStyleSelector:
http://demos.telerik.com/silverlight/#ScheduleView/CustomStyles/AppointmentStyle

Actually, if you group the example above you will have different styles for the different resources, that define in which column the appointmetns will be rendered. (note that you should use the WPF version of the example above, since the control templates are different)

All the best,
Valeri Hristov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

Tags
ScheduleView
Asked by
Nico
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
Share this question
or