Ultimately, my aim is to have a grid (by grid I mean rows and columns, however it’s achieved) of small stack panels to represent time intervals throughout a day. Not too disimilar from the following I suppose (simple calendar-type layout on the right):

(source: msdn.com)
I need a way of creating this grid dynamically and naming the panels appropriately for whenever an event is fired (to be specific – a drop event, each panel’s drop event will be wired to the same method in which I must distinguish what panel (i.e. at what point in the day, and on what row) the item was dropped on).
Thanks a LOT for any help!
Dan
You probably won’t get the full code to do that from here, but I can point you in the right direction.
You are probably going to want to use nested ItemsControl. I have done something like this in the past where my outer
ItemsControlfor the Calendar was aGrid, and grid cell contained an innerItemsControlwith aStackPanelofTaskItems.The most important part is getting your data layer right. I used
CalendarDayModelclasses, which had aDateproperty and anObservableCollection<TaskModel>list. It also had Commands to handle user events, such as double-click events.My outer
ItemsControlwas bound to theObservableCollection<CalendarDayModel>and the innerItemsControlwere bound to theObservableCollection<TaskModel>I have some examples of an ItemsControl here, but take note of the last example that uses a Grid.