惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
T
Threatpost
Latest news
Latest news
N
News | PayPal Newsroom
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Help Net Security
Help Net Security
D
Darknet – Hacking Tools, Hacker News & Cyber Security
AI
AI
Simon Willison's Weblog
Simon Willison's Weblog
TaoSecurity Blog
TaoSecurity Blog
The Last Watchdog
The Last Watchdog
L
LINUX DO - 热门话题
Google DeepMind News
Google DeepMind News
T
Threat Research - Cisco Blogs
O
OpenAI News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
The Exploit Database - CXSecurity.com
NISL@THU
NISL@THU
Application and Cybersecurity Blog
Application and Cybersecurity Blog
S
Securelist
小众软件
小众软件
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Martin Fowler
Martin Fowler
S
SegmentFault 最新的问题
Cisco Talos Blog
Cisco Talos Blog
云风的 BLOG
云风的 BLOG
AWS News Blog
AWS News Blog
GbyAI
GbyAI
N
News and Events Feed by Topic
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
美团技术团队
Engineering at Meta
Engineering at Meta
A
About on SuperTechFans
博客园 - 三生石上(FineUI控件)
S
Schneier on Security
博客园 - 聂微东
V2EX - 技术
V2EX - 技术
T
Troy Hunt's Blog
SecWiki News
SecWiki News
S
Secure Thoughts
B
Blog RSS Feed
Hugging Face - Blog
Hugging Face - Blog
WordPress大学
WordPress大学
腾讯CDC
H
Heimdal Security Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Apple Machine Learning Research
Apple Machine Learning Research
月光博客
月光博客
www.infosecurity-magazine.com
www.infosecurity-magazine.com
P
Privacy International News Feed

博客园 - kings

项目团队成长日志--聆听客户声音,沟通无所不在 TOAD使用筆記 使电脑鼠标右键相应快的办法 非常好用的对日面试资料(转) IT技術者日本語面接(ぎじゅつしゃにほんごめんせつ)によく出(で)る100質問(しつもん) 获取应用程序路径 再议 构造方法(转自Q.yuhen) 基元类型、值类型和引用类型(转自Q.yuhen) C# 2.0 - 泛型(Generics)(转自Q.yuhen) new 和 override 的区别(转自Q.yuhen) “多态”一个需要注意的问题(转自Q.yuhen) C# 方法参数 ref 详述(转自Q.yuhen) 浅析Family Show 2.0的动态换肤实现(转tonyqus) 浅析Family Show 2.0的子窗体实现(转tonyqus) webservice 遇到的小问题 泛型集合类型,赋予集合业务意义,增强集合的抽象使用(转-lizhe1985) WPF_Markup的几种写法 When I tab into a toolbar in WPF I can't tab out again? What can I do to change this tab behaviour? Windows Presentation Foundation(WPF)中的数据绑定(使用XmlDataProvider作控件绑定)(转-大可山)
Windows Presentation Foundation(WPF)中的数据绑定(使用XmlDataProvider作控件绑定之二:使用外部URL的XML文件)(转-大可山)
kings · 2007-09-01 · via 博客园 - kings

<Window
 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 x:Class="WPFDataBinding.BindingRss"
 x:Name="BindingRss1"
 Title="Window1"
 >
<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分别对应下面的具体内容,你可以结合起来仔细分析一下。(如果你对XPath的相关细节不够了解,建议你看一下XSLT相关的书或者到以下链接:http://www.w3.org/TR/xpathhttp://www.w3schools.com/xpath/default.asp

这是http://blog.csdn.net/johnsuna/category/325343.aspx/rss的部分内容:(注意我特别加粗的部分)
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/">
<channel>
  <title>Johnson(大可山)的专栏 -</title>

  <link>http://blog.csdn.net/johnsuna/category/325343.aspx</link>
  <description />
  <dc:language>af</dc:language>
  <generator>.Text Version 1.0.1.1</generator>
  <image>http://counter.csdn.net/pv.aspx?id=72</image>
 <item>
  <dc:creator>大可山</dc:creator>
  <title>Windows Presentation Foundation(WPF)中的数据绑定(使用XmlDataProvider作控件绑定)</title>
  <link>http://blog.csdn.net/johnsuna/archive/2007/08/21/1753001.aspx</link>
  <pubDate>Tue, 21 Aug 2007 15:59:00 GMT</pubDate>
  <guid>http://blog.csdn.net/johnsuna/archive/2007/08/21/1753001.aspx</guid>
  <wfw:comment>http://blog.csdn.net/johnsuna/comments/1753001.aspx</wfw:comment>
  <comments>http://blog.csdn.net/johnsuna/archive/2007/08/21/1753001.aspx#Feedback</comments>
  <slash:comments>0</slash:comments>
  <wfw:commentRss>http://blog.csdn.net/johnsuna/comments/commentRss/1753001.aspx</wfw:commentRss>
  <trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=1753001</trackback:ping>
  <description><img src ="http://blog.csdn.net/johnsuna/aggbug/1753001.aspx" width = "1" height = "1" /></description>
 </item>
 <item>
  <dc:creator>大可山</dc:creator>
  <title>Windows Presentation Foundation(WPF)中的数据绑定(控件与控件值的绑定)</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}的方式进行控件与控件的绑定<img src ="http://blog.csdn.net/johnsuna/aggbug/1752865.aspx" width = "1" height = "1" /></description>
 </item>
<!-- 还有更多 -->
</channel>
</rss>

下图是显示效果:
使用RSS等外部文件进行WPF控件绑定