jjzjj

CollectionViewSource

全部标签

c# - 在 ViewModel 中使用 CollectionViewSource 的正确方法

我使用拖放将数据源对象(数据库模型)绑定(bind)到DataGrid(基本上遵循EntityFrameworkDatabindingwithWPF中的示例。此实现一切正常。XAML..代码隐藏privatevoidWindow_Loaded(objectsender,RoutedEventArgse){System.Windows.Data.CollectionViewSourcecategoryViewSource=((System.Windows.Data.CollectionViewSource)(this.FindResource("categoryViewSource"))

c# - CollectionViewSource 使用问题

我正在尝试对CollectionViewSource进行基本使用,但我肯定遗漏了一些东西,因为它无法正常工作。这是我的XAML:这编译正常,但是当我运行应用程序时我得到这个错误:Cannotconvertthevalueinattribute'ItemsSource'toobjectoftype'System.Collections.IEnumerable'.'System.Windows.Data.CollectionViewSource'isnotavalidvalueforproperty'ItemsSource'.Erroratobject'System.Windows.Con
12