When would the ItemContainerGenerator.Status enumeration return GeneratorStatus.Error in WPF? Has anyone encountered such a situation? Just wondering, as I mainly work in Silverlight and the GeneratorStatus doesn’t exist there.
When would the ItemContainerGenerator.Status enumeration return GeneratorStatus.Error in WPF? Has anyone encountered such a
Share
the
ItemContainerGenerator(if used for example in a ListBox) will create aListBoxItemfor each data item theListBoxis bound to.The standard
ItemContainerGeneratorinPresentationFrameworkhas an private class called ‘Generator‘. When this class is instantiated by theItemContainerGeneratorit sets theItemContainerGeneratorclass’s Status asGeneratorStatus.GeneratingContainers, then when theItemContainerGeneratorcallsDisposeon theGeneratorinstance, theGeneratorclass sets theItemContainerGeneratorstatus toGeneratorStatus.ContainersGenerated.GeneratorStatus.Erroris never used in the standard implmentation, but if your rolling your ownItemsControl, you can roll your ownItemContainerGeneratorand maybe use the error status in your code.