While looking for a solution for an issue I am having, I ran into GetContainerForItemOverride() and I don’t think I understand the documentation.
MSDN says:
Creates or identifies the element that is used to display the given
item.
However, there’s no given item – there’s no parameter being passed into the method.
Out of curiosity – what’s the purpose of this method?
(I obviously searched for it and could not really find an answer)
This method is used by ItemContainerGenerator to get the container for items. Each ItemsControl should specify its own type of item container. For example, ListBox returns instance of ListBoxItem in this method. When you create your own ItemsControl you can override this method and return custom container. Here you will find much more details about ItemContainerGenerator: http://drwpf.com/blog/2008/07/20/itemscontrol-g-is-for-generator/