【发布时间】:2014-11-10 05:16:28
【问题描述】:
我使用了 ObservableCollection 类型的 object 。我尝试通过以下代码进行过滤
public ObservableCollectionView<Person> SampleEntries { get; set; }
private void ApplyFilter(int age)
{
SampleEntries.Filter = (entry => entry.Age > age ) ;
// converting ObservableCollection into AsQueryable
var source = this.SampleEntries.AsQueryable();
//Shows the value as Destination array was not long enough
var source1 = source.OrderByDescending(x => x.Id);
}
应用过滤器后,尝试对列进行排序,它抛出了
Exception : "System.ArgumentException was unhandled by user code" Message=Destination array was not long enough. Check destIndex and length, and the array's lower bounds.
注意:我需要知道为什么这段代码不起作用。我们已经有其他方法来解决这个问题。
更新:ObservableCollectionView 类可以在 MyToolkit 库中找到。
【问题讨论】:
标签: c# linq winrt-xaml mytoolkit