【发布时间】:2017-07-12 04:45:14
【问题描述】:
当我尝试引用资源字典我的 app.xaml 文件时出现以下错误
<Application x:Class="DesignerPoc.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:DesignerPoc"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Dashboard.Designer.WPF;Connection/Views/test.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
错误
An Error occurred while finding the resource dictionary "pack://application:,,,/Dashboard.Designer.WPF;Connection/Views/test.xaml"
如何解决这个问题??
【问题讨论】:
-
添加该资源后,您是否构建了项目?有时 VS 设计器需要构建才能找到资源。此外,当您运行应用程序时,它是否会引发找不到资源的异常?
-
是的。当我构建显示构建成功没有任何错误但是当我运行我的项目应用程序进入中断状态。
标签: wpf data-binding resourcedictionary