我有一个 ItemControl 设置来滚动 RSS 提要中的一些文本。RSS 提要是项目控件正在读取的外部 XML 文档,并且 RSS 提要的内容在屏幕上滚动,就像您在任何 24 小时新闻站上看到的一样。
<ResourceDictionary>
<XmlDataProvider x:Key="RSS" Source="\...\RSS\RSS.xml" >
</ResourceDictionary>...
<ItemsControl DataContext="{Binding Source={StaticResource RSS}, XPath=/rss/channel}" ItemsSource="{Binding XPath=Items}" >
<ItemsControl.DataTemplate>
<!-- data template -->
</ItemsControl.DataTemplate>
</ItemsControl>
我想知道的是,当外部 XML 更改时,如何刷新 ItemsSource 绑定或显示的内容?