Kro*_*owi 2 c# wpf xaml class-library resourcedictionary
我有Class Library
以下代码位。
以下是我UserControl
的Resource
:
<UserControl.Resources>
<ResourceDictionary Source="pack://application:,,,/Mine.Controls;component/Templates.xaml" />
</UserControl.Resources>
Run Code Online (Sandbox Code Playgroud)
下面是我的ResourceDictionary
名为Templates.xaml 的文件:
构建操作:资源
复制到...:不要复制
自定义工具:
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ControlTemplate x:Key="MyButton"
TargetType="Button">
<Border x:Name="buttonBorderOuter"
BorderBrush="#DBDBDB"
BorderThickness="1"
Background="#00ECECEC"
CornerRadius="5" />
</ControlTemplate>
</ResourceDictionary>
Run Code Online (Sandbox Code Playgroud)
然后我得到错误
异常:查找资源字典“pack://application:,,,/Mine.Controls;component/Templates.xaml”时发生错误。
我究竟做错了什么?
归档时间: |
|
查看次数: |
1176 次 |
最近记录: |