WPF常用数据绑定控件集合
2016-01-28 17:40
363 查看
1、怎么用ListView控件把XML中的数据在界面上显示出来?
2、怎么用TreeView控件把XML中的数据在界面上显示出来?
3、怎么用DataGrid控件把XML中的数据在界面上显示出来?
4、怎么用ComboBox控件把XML中的数据在界面上显示出来?
5、怎么用TextBox控件把XML中的数据在界面上显示出来?
<?xml version="1.0" encoding="utf-8" ?> <Person> <Complexion> yellow </Complexion> <Man> <Sex>男</Sex> <Character>血性</Character> </Man> <Woman> <WSex>女</WSex> <WCharacter>温柔</WCharacter> </Woman> </Person>
<Window x:Class="ContainerControl.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"> <Window.Resources> <XmlDataProvider x:Key="Human" Source="Data.xml"> </XmlDataProvider> </Window.Resources> <Grid> <ListView ItemsSource="{Binding Source={StaticResource Human}}" HorizontalAlignment="Left" Height="100" Margin="54,32,0,0" VerticalAlignment="Top" Width="135"> <ListView.View> <GridView> <GridViewColumn Header="男" DisplayMemberBinding="{Binding XPath=/Person/Man/Character}"/> <GridViewColumn Header="女" DisplayMemberBinding="{Binding XPath=/Person/Woman/WCharacter}"/> <GridViewColumn Header="肤色" DisplayMemberBinding="{Binding XPath=/Person/Complexion}"/> </GridView> </ListView.View> </ListView> </Grid> </Window>
2、怎么用TreeView控件把XML中的数据在界面上显示出来?
3、怎么用DataGrid控件把XML中的数据在界面上显示出来?
4、怎么用ComboBox控件把XML中的数据在界面上显示出来?
5、怎么用TextBox控件把XML中的数据在界面上显示出来?
相关文章推荐
- I.MX6 bq27441 driver porting
- iOS图片上传
- Linux内核驱动之GPIO子系统(一)GPIO的使用
- OpenGL实现Volume Rendering 大致步骤
- Python之生成器、迭代器
- linux常用命令
- DLL入门浅析【转】
- android中点击任意空白处隐藏键盘的方法
- FreeRtos heap4源码分析
- 线程小球
- POI dataFormat种类
- C#中Override关键字和New关键字的用法详解
- 反射
- 一条线
- Redis (一) CentOS 安装Redis 2.8.9
- sizeof与类的大小
- 专题4嵌入式文件系统制作
- 如何看懂源代码--(分析源代码方法)
- 【POJ 1275】 Cashier Employment(差分约束系统的建立和求解)
- 图