Given an arbitrary ItemsControl
, is it possible to get the type of the container objects which its ItemContainerGenerator
creates/uses?
For example, given a ListBox
, I'm trying to get the type ListBoxItem
. For a TreeView
, it would be TreeViewItem
, etc.
I'm trying to find a generic solution for any ItemsControl
(or more accurately, any control which utilizes an ItemContainerGenerator
.)
I'm specifically looking for the Type
, not an instance of the type, nor would I like to rely on creating an instance just to check its type.