SortableObservableCollection<T>
2011-05-20 15:47
411 查看
View Code
/// <summary> /// Create a instance of SortableObservableCollection. /// </summary> /// <typeparam name="T">Collection</typeparam> public class SortableObservableCollection<T> : ObservableCollection<T> { public virtual void Sort() { this.Sort(0, Count, null); } public virtual void Sort(IComparer<T> comparer) { this.Sort(0, Count, comparer); } public virtual void Sort(int index, int count, IComparer<T> comparer) { (this.Items as List<T>).Sort(index, count, comparer); OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); } }
相关文章推荐
- c# List<T>与ObservableCollection<T>
- ObservableCollection<T> 的同类 ListCollectionView
- ObservableCollection<T> 成员
- ObservableCollection<T> 成员
- WPF中的List<T>和ObservableCollection<T>
- C# 中的INotifyPropertyChanged和ObservableCollection<T>
- wpf list<T>与ObservableCollection<T>的区别
- 【转】list<T>与ObservableCollection<T>的区别
- ObservableCollection<T> 类
- IEnumerable<T>转换成ObservableCollection<T>
- c# List<T>与ObservableCollection<T>
- list<T>与ObservableCollection<T>
- List<T>和ObservableCollection<T>的相互转化
- ObservableCollection<T>类
- ObservableCollection<T> 类
- 简析SilverLight的List<T>、ObservableCollection<T>和INotifyPropertyChanged的异同
- ObservableCollection<T> 类
- C# Winform DataGrid 绑定List<> Or ObservableCollection<> 类型无法自动刷新问题
- .NET漫游指南-005-INotifyProperChanged和List<>,ObservableCollection<>使用
- wpf中ist<T>与ObservableCollection<T>的用法区别