我在 .NET Core for Linux (Fedora) 上运行 Avalonia UI。我已经按照DataGrid 的本教程进行操作,但老实说,我已经使用以下命令添加了包,而不是手动更新.csproj
.
dotnet add package Avalonia.Controls.DataGrid
在 adotnet restore
和 a之后dotnet run
,我看不到任何 DataGrid。无论如何xml
<StackPanel>
<DataGrid AutoGenerateColumns="True" Items="{Binding People}"/>
</StackPanel>
和 ViewModel 看起来不错。
public ObservableCollection<Person> People { get; }
public MainWindowViewModel()
{
People = new ObservableCollection<Person>(GenerateMockPeopleTable());
}
我怎样才能找到问题所在?