There is no property for this purpose but you can utilize the Calendar.ItemModifying and Calendar.ItemCreating events. In the handlers of these events you can validate user interactions and eventually reject them. Here is an example code which does not allow items to be created or dragged over a period of time (Mar, 10th - Mar, 16th):
private void calendar_ItemModifying(object sender, ItemModifyConfirmEventArgs e)
{
if (Intersects(e.Item.StartTime, e.Item.EndTime, DisabledZoneStart, DisabledZoneEnd))
e.Confirm = false;
}
private void calendar_ItemCreating(object sender, ItemConfirmEventArgs e)
{
if (Intersects(e.Item.StartTime, e.Item.EndTime, DisabledZoneStart, DisabledZoneEnd))
e.Confirm = false;
}
private static readonly DateTime DisabledZoneStart = new DateTime(2011, 3, 10);
private static readonly DateTime DisabledZoneEnd = new DateTime(2011, 3, 17);
private static bool Intersects(DateTime start1, DateTime end1, DateTime start2, DateTime end2)
{
return start2.Ticks < end1.Ticks && start1.Ticks < end2.Ticks;
}
To run the above code, please use the new version of the control from this post:
http://mindfusion.eu/Forum/YaBB.pl?board=scheduling_silverlight;action=display;n...Let me know if this helps.
Regards,
Meppy