我正在使用 avalonia 创建一个应用程序,由于可重用性,该应用程序在另一个程序集中有一些 UI 内容。在这个额外的程序集中,我想要一个 Resource.xml 文件,它被应用程序项目和其他项目引用。它包含样式等。
内容:
<ResourceDictionary
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
>
<Style x:Key="normal_button" Selector="Button.normal_button">
<Setter Property="Margin" Value="0" />
<Setter Property="Height" Value="25" />
<Setter Property="MinWidth" Value="75" />
</Style>
</ResourceDictionary>
错误:
Unable to find suitable setter or adder for property Content of type Avalonia.Styling:Avalonia.Controls.ResourceDictionary for argument Avalonia.Styling:Avalonia.Styling.Style, available setter parameter lists are: ...
我究竟做错了什么?.csproj 文件中是否有一些必要的条目?