Dear all,
In my application I would like to read some XAML code and create some UI controls described by it. I used the following code:
UIControlClass uiControl = (UIControlClass)System.Windows.Markup.XamlReader.Load(streamContainingTheXAMLcode);
and it worked fine for controls like Buttons and Grids, for example, but when I tried to create the whole window (which by the way is of class Window1 : Window) XamlParseException which says:
"'Class' attribute does not exist in XML namespace 'http://schemas.microsoft.com/winfx/2006/xaml' namespace. Line '4' Position '5'."
was thrown. If I remove part of XAML code which determines Class of my window, in this particular case
x:Class="SkinFriendlyApplication1.Window1"
the exception is not thrown and the above C# code works, but the window created is of Class Window and I lose all my Window1 functionality.
Is there any way to explain to XamlReader what "'Class' attribute" is, and if so, how?
Also, if three is some other way to read XAML code and create controls based on it, that would be satisfactory solution, too.
Thanks in advance.