WPF数据绑定(2) 绑定到XML
2008-07-10 10:50
344 查看
<Window.Resources> <XmlDataProvider x:Key="XML">//自己手动写的 <x:XData> <Colors> <Color>红</Color> <Color>黄</Color> <Color>蓝</Color> </Colors> </x:XData> </XmlDataProvider> <XmlDataProvider x:Key="ttxml" Source="tt.xml">//绑定到外部XML文件 </XmlDataProvider> </Window.Resources> <StackPanel> <ListBox Height="69" ItemsSource="{Binding Source={StaticResource XML},XPath=/Colors/Color}" Width="191" /> <ListBox Height="100" Margin="10" ItemsSource="{Binding Source={StaticResource ttxml},XPath=/Data/ff}"/> </StackPanel>
相关文章推荐
- Windows Presentation Foundation(WPF)中的数据绑定(使用XmlDataProvider作控件绑定之二:使用外部URL的XML文件)
- WPF 数据绑定TreeView+DataGrid+XML
- WPF: ListBox绑定xml数据
- Windows Presentation Foundation(WPF)中的数据绑定(使用XmlDataProvider作控件绑定)
- WPF数据绑定到各种数据源系列(XML数据源)
- WPF学习笔记:(二)数据绑定模式与INotifyPropertyChanged接口
- XML 与 Java 技术: 用 Castor 进行数据绑定
- WPF绑定各种数据源之xml数据源
- WPF学习之数据绑定
- 绑定任意格式的XML文档到WPF的TreeView
- WPF笔记(4.3 集合数据绑定)——Data Binding
- WPF 数据控件绑定数据与 ASP.NET数据控件绑定数据的区别
- 利用XML数据绑定实现页面无刷新的数据浏览
- 实现WPF元素同CLR元素的数据绑定的一般步骤
- 从XML到Java代码的数据绑定之对象
- WPF----数据绑定
- WPF学习之数据绑定
- WPF数据绑定之数据模板
- 【转】WPF中PasswordBox控件的Password属性的数据绑定
- 从XML到Java代码的数据绑定之二