How about simply stacking the Image on top of the ItemsControl , placing it in a parent panel that allows you to overlap controls like Grid or Canvas ?
<Grid> <ItemsControl ... /> <Image Source="/images/image.png" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5,5,0,0" /> </Grid>
In the code sample, I just set marker 5 for the top and left margin fields, but you probably need to associate this a bit in order to associate the image with the first Grid cell.
Also, if you need to dynamically set the height / width of the image to make it the same size as the Grid cell, you can bind the Height and Width properties of the image to the ItemsControl ActualHeight / ActualWidth and use the converter to find out 1 / 10th of that size (for I have a MathConverter on my blog that will make this easy)
The only alternative I could think of would be to add it to the code after the elements were generated
void MyItemsControl_Loaded(object sender, EventArgs e) { MyItemsControl.ItemContainerGenerator.StatusChanged += ItemContainerGenerator_StatusChanged; } void ItemContainerGenerator_StatusChanged(object sender, EventArgs e) { if (MyItemsControl.ItemContainerGenerator.Status == System.Windows.Controls.Primitives.GeneratorStatus.ContainersGenerated) {
This is not exactly ideal, and I would do my best to simply place the image on top of the ItemsControl element first.
source share