0

I need to create a fortnight calendar with dates as rows and 24 hours as columns in WPF. In this need to show hours booked as horizontal bars. For eg. if start time is 7.00 and end time is 11.00 then we need to show a bar that from 7.00 to 11.00. The requirement is just view only based on the data passed (dynamic based on fortnight start date). No scheduling function required. Cannot use a commercial product. Can anybody guide me in the right direction? Looking for a solution in MVVM.

Thanks a lot in advance.

  • This needs more focus. However, you may perhaps use a 14x24 Grid as the ItemsPanel of an ItemsControl, and in an ItemContainerStyle bind Grid.Row, Grid.Column and Grid.ColumnSpan to properties of the data item, as e.g. done here: https://stackoverflow.com/q/6995844/1136211 – Clemens Jun 11 '21 at 10:21
  • I'd consider an itemscontrol for days with an itemscontrol for hours within that. Stick a rectangle in each hour.item and change it's fill. There are some "but what if they want to.... " questions though. What about half hour or 10 minute slots in those hours? Maybe you'd want a third itemscontrol nested in each hour if you need 10 minute steps. Build out some simple viewmodels representing state of each hour or slot. You have a 3 hour session. That's 3 busy viewmodels. The other hours are non busy viewmodels. – Andy Jun 12 '21 at 14:48
  • Sorry Guys!! was busy with other work, hence was not able work on the diary until yesterday. Thank you Clemens - I followed your suggestion and it worked beautifully. – Sajju Thambi Jun 21 '21 at 05:29

0 Answers0