Hi,
I am using XamScheduleDataManager and create my resources and resourcecalendars in my view model and bind these fine. I want to dynamically create my calendar groups and bind them as I do with my resources etc. The only examples I have found is to do it in the code behind of the view but I want to do it via the view model is this possible.
Hello Anne,
I have been looking into your question and I can suggest your look through the Mihail’s blog about using XamSchedule :
http://es.infragistics.com/community/blogs/mihail_mateev/archive/2010/10/25/how-to-use-infragistics-xamschedule-solution.aspx
in order to see how he adds the calendar groups in his ScheduleViewModel. It seems that this is the best approach I can suggest.
Let me know, if you need any further assistance on this matter.
This example creates the calendar groups in the code behind of the view, it does not bind it via the view model.
Thank you for your reply. Currently this is the best way for using CalendarGroups in XamSchedule.
Let me know, if I can assist you with anything else on this matter.
I have managed to do this without adding code behind simply by adding event trigger to load of source. I have another question though, how can I set the background of the time slots, to be a different colour. e.g. 10:00 to 13:00 pink, 13:00 to 17:00 blue etc.
Thank you for your feedback. Regarding your second question you can look into the following forum thread where Andrew has provided a suggestion on how to set brush for specific time slots :
http://es.infragistics.com/community/forums/p/48102/256619.aspx
You can easy determine it by handling ‘PreviewMouseUp’ event of the XamScheduleView like :
private void scheduleView_PreviewMouseUp(object sender, MouseButtonEventArgs e)
{
if (this.scheduleView.SelectedActivities.Count != 0 && this.scheduleView.SelectedActivities[0] is Appointment)
Appointment app = this.scheduleView.SelectedActivities[0] as Appointment;
}
Please in future create a separate thread for each of your questions.
Is there a way to determine which appointment selected?