如何在 Silverlight 中创建月视图控件
我需要创建一个像月视图控件这样的 Outlook 来显示约会。 (显示一个月中所有日期的网格,工作日垂直对齐。应显示每天的天数和星期几,并且约会应显示在正确日期内的列表视图中)
我需要一些关于从哪里开始的输入。
假设 ViewModel 看起来像这样:
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; }
}
我是否需要手动布置日期并安排约会,或者我可以做得更优雅吗?
我已经尝试了几种绑定方法,但均不成功。关于做什么的任何提示?
问候拉尔西
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
几周前我就做了这件事。我所做的是创建两个 silverlight 用户控件,一个用于当天,一个用于月份。
月份控件用日期控件填充名为 MonthRows 的堆栈面板,如下所示:
ucDay 构造函数接受年、月、日、委托函数指针(以处理单击事件)和当前选定的日期作为参数。
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.