国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開通VIP
Windows Presentation Foundation(WPF)中的數(shù)據(jù)綁定(使用XmlDataProvider作控件綁定之二:使用外部URL的XML文件)
 Windows Presentation Foundation(WPF)中的數(shù)據(jù)綁定(使用XmlDataProvider作控件綁定之二:使用外部URL的XML文件)  
  

--------------------------------------------------------------------------------
引用或轉(zhuǎn)載時(shí)請(qǐng)保留以下信息:
大可山 [MSN:a3news(AT)hotmail.com]
http://www.zpxp.com http://www.brawdraw.com
蘿卜鼠在線圖形圖像處理
--------------------------------------------------------------------------------

3、使用外部URL鏈接的XML文件作為數(shù)據(jù)源
事實(shí)上,在上文Windows Presentation Foundation(WPF)中的數(shù)據(jù)綁定(使用XmlDataProvider作控件綁定) 中,XmlDataProvider的Source屬性還可以直接指向你本機(jī)的某個(gè)XML文件:
<XmlDataProvider x:Key="FavoriteColors" Source="E:\Books\xaml\FavoriteColors.xml" />

我們還可以指向任何標(biāo)準(zhǔn) URL,這樣,我們就可以創(chuàng)建對(duì)XML API(如 RSS)的快速訪問。
比如,我的BLOG中關(guān)于WPF的RSS地址是: >
<Canvas x:Name="LayoutRoot">
<StackPanel Height="243.687">
  <StackPanel.Resources>
   <XmlDataProvider x:Key="MyRSS"
    Source="
http://blog.csdn.net/johnsuna/category/325343.aspx/rss" />
 </StackPanel.Resources>

 <TextBlock x:Name="txtBlockTitle" Text="{Binding Source={StaticResource MyRSS}, XPath=//channel/title}" HorizontalAlignment="Center"
               FontWeight="Bold"/>
 <ListBox Width="500" Height="300"
             ItemsSource="{Binding Source={StaticResource MyRSS}, XPath=//item/title}">
 </ListBox>
 </StackPanel>
</Canvas>
</Window> 

上面 XPath=//channel/title , XPath=//item/title分別對(duì)應(yīng)下面的具體內(nèi)容,你可以結(jié)合起來仔細(xì)分析一下。(如果你對(duì)XPath的相關(guān)細(xì)節(jié)不夠了解,建議你看一下XSLT相關(guān)的書或者到以下鏈接:http://www.w3.org/TR/xpath,http://www.w3schools.com/xpath/default.asp

這是http://blog.csdn.net/johnsuna/category/325343.aspx/rss的部分內(nèi)容:(注意我特別加粗的部分)
<rss version="2.0" xmlns:dc=" </item>
 <item>
  <dc:creator>大可山</dc:creator>
  <title>Windows Presentation Foundation(WPF)中的數(shù)據(jù)綁定(控件與控件值的綁定)</title>
  <link>http://blog.csdn.net/johnsuna/archive/2007/08/21/1752865.aspx</link>
  <pubDate>Tue, 21 Aug 2007 14:51:00 GMT</pubDate>
  <guid>http://blog.csdn.net/johnsuna/archive/2007/08/21/1752865.aspx</guid>
  <wfw:comment>http://blog.csdn.net/johnsuna/comments/1752865.aspx</wfw:comment>
  <comments>http://blog.csdn.net/johnsuna/archive/2007/08/21/1752865.aspx#Feedback</comments>
  <slash:comments>0</slash:comments>
  <wfw:commentRss>http://blog.csdn.net/johnsuna/comments/commentRss/1752865.aspx</wfw:commentRss>
  <trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=1752865</trackback:ping>
  <description>使用類似{Binding ElementName=txtBoxInput,Path=Text}的方式進(jìn)行控件與控件的綁定<img src ="
 </item>
<!-- 還有更多 -->
</channel>
</rss>

下圖是顯示效果:

打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
花 2 小時(shí)就能做出一個(gè) RSS 生成器
訂閱須知--寫給RSS新手 - 老白說真話|LaoBai‘s Blog
為動(dòng)態(tài)網(wǎng)站制作RSS內(nèi)容輸出的程序模版
實(shí)現(xiàn)RSS的原理
RESTful GeoWeb學(xué)習(xí)手記(七):[轉(zhuǎn)]Atom 1.0 Syndication Format 概述
滾動(dòng)信紙文本框
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服