CollectionViewSource使用问题
我正在尝试基本使用CollectionViewSource,我必须遗漏一些东西,因为它只是不起作用。 这是我的XAML:
这编译很好,但是当我运行应用程序时,我收到此错误:
无法将属性'ItemsSource'中的值转换为类型的对象 'System.Collections.IEnumerable'。 'System.Windows.Data.CollectionViewSource' 不是属性'ItemsSource'的有效值。 对象出错 标记文件'WIAssistant'中的'System.Windows.Controls.ListBox';组件/ main.xaml
这是我附加的集合:
// The mappings used to copy the values of the fields of one WorkItem to another. public ObservableCollection WorkItemTypeMappings { get { return (ObservableCollection) GetValue(WorkItemTypeMappingsProperty); } set { SetValue(WorkItemTypeMappingsProperty, value); } } public static readonly DependencyProperty WorkItemTypeMappingsProperty = DependencyProperty.Register("WorkItemTypeMappings", typeof(ObservableCollection), typeof(MainMediator), new UIPropertyMetadata(null));
我只想对对象Project SourceProject
进行简单的分组。 我宁愿不必为此打破树视图。
这应该适合你