I have ~30 controls, each with the same model. I want, instead of having ~30 properties bound and ~30 private variables, to bind to an array, allowing me also to loop on the properties
For examle,
Say I have the following (It's just an example)
public class MyImage
{
public String source { get; set;}
public String tooltip { get; set;}
}
xaml
<Grid>
<Image Name="image0" Source="{Binding MyImage0.source"}/>
<Image Name="image1" Source="{Binding MyImage1.source"}/>
<Image Name="image2" Source="{Binding MyImage2.source"}/>
...
</Grid>
I want instaead of that XAML file, to have the source as something like MyImages[0].source
so I could also loop over it and set it in runtime and not have to write MyImage0.source="mysource"
ItemsControlwithItemsSourceset to collection ofMyImageobjects