I am creating a WPF user control that comes from TabControl. In the ControlTemplate, I use ItemControl to display the list associated with the template (an observable collection of type FileMenuItem). While the program is running, I get the following error in the output window:
ItemTemplate and ItemTemplateSelector are ignored for items that are already Container Type ItemsControl; Type = 'FileMenuItem'
The FileMenuItem type is inferred from MenuItem. If I changed the base class to DependencyObject, the code really runs and the template is applied (so there is an option). I googled a bug and couldn't find anything about this, does anyone encounter this while developing custom controls? Despite the fact that I have a workaround, I would like to understand what is happening, and I think that using MenuItem as a base class is a cleaner implementation.
I can post more code if this helps. Thanks!
c # wpf
Patrick white
source share