0

嗨,下面给出的是使用 xml 文件。我想显示数据 web 视图。如何在 windows phone 7 中获取 web 视图?

<Articles>
   <articles title="photos">
       <Description>
          Hottie Mallika Sherawat speaks about the men whom she’s over the moon about
       </Description>
       <Fullcontent>
          <style> img {padding:2px;} </style><p> <img alt="Mallika Sherawat" pimcore_disable_thumbnail="true" pimcore_id="5853" pimcore_type="asset" src="http://dev2.mercuryminds.com/bolly/feb2013/bolly---mallika-sherawat-s-upcoming-movie-dirty-politics/90_mallika-sherawat_bolly.jpg" style="width: 500px; height: 370px; float: left;" /></p>
          <p> Actress Mallika Sherawat is all set to begin shooting for&nbsp;<em>Dirty Politics</em>&nbsp;where she plays Bhanwari Devi, a nurse whose murder hit the headlines last year. Meanwhile, she gets talking on&nbsp;Hollywood where she has not really had any meaty roles. She does not seem to care though. “It’s not important to play full length roles. Being recognised for playing whatever I did makes me feel proud.”&amp;nbsp;</p>
       </Fullcontent>
     </articles>
     <articles> 
        <Description> 
           <p> Legendary singer <strong>Asha Bhosle</strong> has added yet another feather to her cap with her acting debut in Mai. She plays the lead role of a woman abandoned by her son. 
        </Description> 
        <Fullcontent> 
          <div id="container" class="cf"> 
           <link rel="stylesheet" href="http://dev2.mercuryminds.com/imageslider/app/css/demo.css" type="text/css" media="screen" />
           <link rel="stylesheet" href="http://dev2.mercuryminds.com/imageslider/app/css/flexslider.css" type="text/css" media="screen" />
           <div id="main" role="main"> <section class="slider"> 
           <div class="flexslider"> 
           <ul class="slides">
             <li>Sonam Kapoor<img src="http://dev2.mercuryminds.com/website/var/tmp/thumb_5814_1_sonam-kapoor_01feb2013__appfeed.jpeg" alt="Sonam Kapoor"/></li> 
             <li>Sridevi<img src="http://dev2.mercuryminds.com/website/var/tmp/thumb_5815_2_sridevi_01feb2013__appfeed.jpeg" alt="Sridevi"/></li> 
        </Fullcontent> 
     </articles> 
 </Articles>

我想使用 Windows Phone 7 的 Web 浏览器控件显示来自 xml 文件的 Fullcontent 标记的 Web 视图。请帮我一个...,谢谢提前。

4

1 回答 1

0

你或许可以以此为起点

http://msdn.microsoft.com/en-us/library/ff402601(v=VS.92).aspx

http://blogs.msdn.com/b/dohollan/archive/2010/08/25/adventures-with-the-windows-phone-7-webbrowser-control.aspx

从 XML 创建 html 字符串后,您可以执行

webBrowser1.NavigateToString(html); 

并且为了处理您的 XML 文件,因为这只是一个基本的 XML 文件,您可以执行类似的操作。

    var xDoc = XDocument.parse("[YOUR XML STRING]");
    var articles = xDoc.Root.Elements("articles").select(e=>new {
     desc = e.Element("Description").Value,
     fullContent = e.Element("FullContent").Value

});
于 2013-03-19T10:34:27.493 回答