I'm trying to load a xaml file at runtime. My code looks like this:
StringReader stringReader = new StringReader(xamlString);
XmlReader xmlReader = XmlReader.Create(stringReader);
content = XamlReader.Load(xmlReader);
It's basically copy paste of of msdn. the XamlReader.Load line throws a XamlParseException with an inner exception of "Stack Empty at line....".
The line it points to is the closing tag of the user control found in the xaml string, the last line of the string.
The basic Xaml structure is as follows
<UserControl>
<UserControl.Resources>
</UserControl.Resources>
<Grid>
</Grid>
</UserControl>
Googling didn't turn anything up. Any help in find a solution is much appreciated.