【发布时间】:2019-01-20 06:43:14
【问题描述】:
我有一个具有以下结构的项目:
Proj
├──Views
├ ├──Dashboard.xaml
├ ├──Dashboard.cs
├
├──Styles
├──DashboardStyle.xaml
在我的DashboardStyle.xaml,我有这个代码:
<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">
<Style x:Key="MyWindowStyle" TargetType="local:Proj/Views/Dashboard">
....
....
</Style>
</ResourceDictionary>
但它给出了错误:
命名空间“clr-namespace:Proj.Styles”中不存在名称“Proj/Views/Dashboard”
我该如何解决这个问题?
【问题讨论】:
-
不应该
local是clr-namespace:Proj.Views吗?然后TargetType变为local:Dashboard。
标签: c# wpf xaml resourcedictionary