Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2320
Display labels for all times in TimeslotHeaderArea
posted

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?

 

Parents
No Data
Reply
  • 2320
    posted

    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}"/>

Children