2013-09-25 77 views
0

我試圖讓簡單的HTML結構(幾< P>,< EM>,< i>和東西)用的TextBlock或RichTextBox的XAML行爲上下工夫的WindowsPhone 8HtmlAgilityPack - 將HTML設置爲XAML並綁定到RichTextBox/TextBlock?

我發現HtmlAgilityPack,似乎以適應我的需求。 但我不知道如何從HTML-String中正確地格式化XAML代碼。

我做了以下嘗試(S):

 HtmlDocument doc = new HtmlDocument(); 
     doc.LoadHtml(data.content); 

     doc.OptionOutputAsXml = true; 

     MemoryStream str = new MemoryStream(); 
     XmlWriter outStream = XmlWriter.Create(str); 
     doc.Save(outStream); 
//How to go on from here? (eg. making a string from the stream?) 
//How to assign the XML-String to RichTextBlock? 

回答