I need to create a outlook like monthview-control for showing appointments. (a grid showing all days in a month, with the weekdays aligned vertically. Day number and dayofweek should be shown for every day, and the appointments should be shown in a listview inside the correct day)
And I need some input on where to start.
Say the ViewModel would look something like this:
public class MonthViewModel
{
public List<DateTime> DaysInMonth { get; set; }
public List<Appointment> Appointments { get; set; }
}
public class Appointment
{
public string Title { get; set; }
public DateTime Start { get; set; }
public string Description { get; set; }
}
Do I need to manually lay out the days, and place the appointments, or can I do it more elegant?
I’ve tried several apporoches with binding but all unsuccessful. Any hints on what to do?
Regards Larsi
I did this exact thing a few weeks ago. What I did was create two silverlight user controls, one for the day and one for the month.
The month controls fills a stackpanel named MonthRows with day controls like this:
The ucDay constructor takes in the Year, Month, Day, delegate function pointer (to handle click-events) and the current selected date as parameters.