Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. XamlXmlReader in Framework 4

XamlXmlReader in Framework 4

Scheduled Pinned Locked Moved .NET (Core and Framework)
questionwpfbeta-testing
2 Posts 1 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    od ananzi co za
    wrote on last edited by
    #1

    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

    O 1 Reply Last reply
    0
    • O od ananzi co za

      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

      O Offline
      O Offline
      od ananzi co za
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups