【发布时间】:2016-01-20 07:36:53
【问题描述】:
我首先创建了一个用户控件 dll,并在该 dll 中编写了用于制作按钮样式的代码。 dll中的代码如下所示
<Style x:Key="myStyle" TargetType="Button">
<Setter Property="Background" Value="Orange" />
<Setter Property="FontStyle" Value="Italic" />
<Setter Property="Padding" Value="8,4" />
<Setter Property="Margin" Value="4" />
</Style>
之后我将此引用添加到我的主项目中作为引用-->添加引用-->浏览-->mystyles.dll
现在我想使用这个 dll 为我的主项目中的按钮制作样式。因此,我在 app.xaml 中添加了如下所示的代码
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/References;component/Resources/UserControl1.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
但出现错误,我不知道添加路径的正确语法..请帮助我
【问题讨论】: