XamlXmlReader in Framework 4
-
Hi All, I am trying to load a XAML string and convert it into a FlowDocument object as follows: return XamlXmlReader.Load(new XmlTextReader(new StringReader(xaml))) as FlowDocument; It seems that the Load function has not been implemented (yet?) in the Beta 2 of Framework 4. According to all documentation that I can find it should be there, or at least XamlReader.Load How can I convert a XAML string to a FlowDocument otherwise ? Thanks OD
-
Hi All, I am trying to load a XAML string and convert it into a FlowDocument object as follows: return XamlXmlReader.Load(new XmlTextReader(new StringReader(xaml))) as FlowDocument; It seems that the Load function has not been implemented (yet?) in the Beta 2 of Framework 4. According to all documentation that I can find it should be there, or at least XamlReader.Load How can I convert a XAML string to a FlowDocument otherwise ? Thanks OD
I eventually managed to solve my problem; it turned out to be a namespace problem. The XamlXmlReader and XamlReader classes I tried using existed in the System.Xaml namespace. I should have used the classes in the System.Windows.Markup namespace. The solution thus was: return System.Windows.Markup.XamlReader.Load(new XmlTextReader(new StringReader(xaml))) as FlowDocument; Works like a charm ! OD