I want to display the times of all timeslots in the DayViewTimeslotHeaderArea (so 3pm, 3.15pm, 3.30pm etc), instead of just the starting hour (3pm, 4pm etc).
I realise I'll probably have to retemplate the DayViewTimeslotHeaders but I'm not sure how to get the start time of the timeslot from the headers. Is this even possible?
Ok, I got a bit ahead of myself there. I found a Start property on the parent DayViewTimeslotHeader which I somehow didn't see before.
Adding a TextBlock to the DayViewTimeslotHeader's ControlTemplate and binding the Text to the Start property basically gave what I wanted.
But to make it work, I had to use a RelativeSource binding to the TemplatedParent:
<TextBlock Text="{Binding Start, RelativeSource={RelativeSource TemplatedParent}}" />
instead of a TemplateBinding:
<TextBlock Text="{TemplateBinding Start}"/>
Not sure why you would need to use the Binding w/ RelativeSource unless you didn't set the TargetType on the ControlTemplate.
I'm not sure either. I copied the DayViewTimeslotHeader style and control template directly from the supplied Infragistics resource dictionaries and only added the extra TextBlock, so evreything is as it should be. And the TargetType is indeed set.
When I used a TemplateBinding, the TextBlock's Text field was empty (Snoop verified this).
But I noticed various other properties in the ControlTemplate which also use the RelativeSource bindings instead of TemplateBindings so I didn't think too much of it.