小编Aci*_*kie的帖子

Avalonia 中的 Resource.xaml

我正在使用 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>
Run Code Online (Sandbox Code Playgroud)

错误:

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: ...
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么?.csproj 文件中是否需要某些条目?

xaml avaloniaui avalonia

5
推荐指数
1
解决办法
4677
查看次数

标签 统计

avalonia ×1

avaloniaui ×1

xaml ×1