类型是使用名称空间和类型名称引用的,而不是通过物理文件路径引用的。
所以要引用类型
Proj.Views.Dashboard
,添加相应的命名空间作为XML命名空间声明,并在targetType属性中使用它,例如
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Proj.Styles"
xmlns:views="clr-namespace:Proj.Views" >
<Style x:Key="MyWindowStyle" TargetType="views:Dashboard">
....
....
</Style>
</ResourceDictionary>