I'm creating a custom control called FooControl derived from ItemsControl have a default style defined for the same in themes\generic.xaml.
The default style for FooControl sets ItemsPanel property to another custom panel called FooPanel as below (I don't think the usage of custom panel matters for this question).
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<local:FooPanel IsItemsHost="True"/>
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
In the code behind of my FooControl, I want to get access to the instance of FooPanel that was created automatically. By looking in reflector I found that ItemsControl does have a property called ItemsHost but I cannot access it from FooControl as ItemsHost is internal
Can someone plz suggest me a reliable way to get reference to the instance of FooPanel?