ObservableCollection<T> 类
2014-04-05 19:10
204 查看
命名空间: System.Collections.ObjectModel
程序集: System(在 System.dll 中)
XAML 的 XMLNS: 未映射到 xmlns。
添加:using System.Collections.ObjectModel;
定义类:
程序集: System(在 System.dll 中)
XAML 的 XMLNS: 未映射到 xmlns。
添加:using System.Collections.ObjectModel;
ObservableCollection<Persons> persons = new ObservableCollection<Persons> { new Persons { CurrPerson = new List<Person> { new Person{Name="姓名1", Age=21}, new Person{Name="姓名2", Age=23} } }, new Persons { CurrPerson = new List<Person> { new Person{Name="姓名4", Age=21}, new Person{Name="姓名5", Age=23} } } }; 作为数据源: list1.ItemsSource = persons;
定义类:
class Person { public string Name { get; set; } public int Age { set; get; } public string Image { set; get; } public string Email { set; get; } } class Persons { public List<Person> CurrPerson { set; get; } }
相关文章推荐
- wpf list<T>与ObservableCollection<T>的区别
- wpf list<T>与ObservableCollection<T>的区别
- List<T>转换为ObservableCollection<T>
- wpf中ist<T>与ObservableCollection<T>的用法区别
- list<T>与ObservableCollection<T>
- c# List<T>与ObservableCollection<T>
- ObservableCollection<T> 类
- IEnumerable<T>转换成ObservableCollection<T>
- 简析SilverLight的List<T>、ObservableCollection<T>和INotifyPropertyChanged的异同
- 简析SilverLight的List<T>、ObservableCollection<T>和INotifyPropertyChanged的异同
- SilverLight的List<T>、ObservableCollection<T>和INotifyPropertyChanged
- List<T>和ObservableCollection<T>的相互转化
- C# 中的INotifyPropertyChanged和ObservableCollection<T>
- ObservableCollection<T> 成员
- List<T>和ObservableCollection<T>的相互转化
- C# ObservableCollection<T>的null和count=0区别
- C# 中的INotifyPropertyChanged和ObservableCollection<T>
- ObservableCollection<T> 成员
- 可观察的集合---ObservableCollection<T>
- .NET漫游指南-005-INotifyProperChanged和List<>,ObservableCollection<>使用