【发布时间】:2020-04-25 15:55:08
【问题描述】:
我在 .NET Core for Linux (Fedora) 上运行 Avalonia UI。
我已经关注 this tutorial 的 DataGrid,但老实说,我使用以下命令添加了包,而不是手动更新 .csproj。
dotnet add package Avalonia.Controls.DataGrid
在dotnet restore 和dotnet run 之后,我看不到任何DataGrid。
无论如何 xaml
<StackPanel>
<DataGrid AutoGenerateColumns="True" Items="{Binding People}"/>
</StackPanel>
ViewModel 看起来不错。
public ObservableCollection<Person> People { get; }
public MainWindowViewModel()
{
People = new ObservableCollection<Person>(GenerateMockPeopleTable());
}
我怎样才能找到问题所在?
【问题讨论】:
标签: c# xaml .net-core avaloniaui