Code Summary: The TextItems property is null. This cannot help the XAML parser.
According to experimental results: I get an exception when starting the application in the debugger (I use Silverlight 4):
System.Windows.Markup.XamlParseException occurred Message=Collection property '__implicit_items' is null. [Line: 12 Position: 40] LineNumber=12 LinePosition=40 StackTrace: at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator) InnerException:
You must initialize TextItems. You must also make the setter private so that others cannot ruin you. Try this, you should find that it works fine:
public class TextItemCollection { public TextItemCollection() { TextItems = new ObservableCollection<TextItem>(); } public ObservableCollection<TextItem> TextItems { get; private set; } }
source share