【发布时间】:2020-04-27 08:08:09
【问题描述】:
我有一个XAML 和一个MVVM 显示一个DataGrid 和一个ObservableCollection。
一切正常(我之前的更多细节,我自己已经回答了,question)。
现在我正在尝试添加一个过滤器,我想关注@mark-heath tutorial。
我的项目构建引发以下问题
error CS0246: The type or namespace name 'ICollectionView' could not be found (are you missing a using directive or an assembly reference?)
即使我确实包含了documented namespace。
using System.ComponentModel;
关于哪个 Studio Code 改为显示 Unnecessary using directive。
我的 .csproj 在 .NET Core 3.0 上
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
问题似乎与我添加程序集引用的方式有关。
dotnet add package WindowsBase
它使用 .NET Framework 恢复包,但可能这是错误的,因为我使用的是 .NET Core 和 Linux。
哪种方法是正确的?除了“你不能那样做”的答案...也许有另一个,等效的包要添加...来自 Avalonia UI?有人知道或使用它吗?
在 Avalonia UI github 上搜索并在 gitter 上询问
我看到有一个已经关闭的github issue,所以现在可能有解决方案吗? (我也在询问 Avalonia UI gitter channel)
【问题讨论】:
-
您是否考虑过使用DynamicData 代替CollectionViewSource?这是一种便携的解决方案,也更加灵活。
标签: c# .net-core avaloniaui