I've got a ListBox in Silverlight2 that is using a Grid as its ItemsPanelTemplate. In code, how do I get a reference to that Grid?
<ItemsPanelTemplate x:Key="GridItemsPanel">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
</Grid>
</ItemsPanelTemplate>
<ListBox ItemsPanel="{StaticResource GridItemsPanel}" />
Background:
What I am trying to do with this is add children to the Grid that are not ListBoxItems. I am trying to get something similar to the Outlook Calendar day view, where items can be aligned on a grid with a resolution of 30 minutes. I have the grid and the ListBoxItem positioning working correctly, however I'd like to be able to render background colours, gridlines, hour labels etc to allow the user to clearly see the time and duration of the ListBoxItems.