wpf - VS2017 : An Error Occured while finding the resource dictionary

标签 wpf data-binding resourcedictionary

当我尝试引用资源字典我的 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>

错误

查找资源字典“pack://application:,,,/Dashboard.Designer.WPF;Connection/Views/test.xaml”时发生错误

refer the image

如何解决这个问题??

最佳答案

你的 Resource File Pack URI是错误的。

它应该是这样的,包括component部分:

pack://application:,,,/Dashboard.Designer.WPF;component/Connection/Views/test.xaml

关于wpf - VS2017 : An Error Occured while finding the resource dictionary,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45048632/

相关文章:

c# - 如何从 WPF TextBlock 中删除额外的填充?

wpf - DataGridTextColumn.MaxLength?

.net - 如何绑定(bind) WinForm 文本框以在 TextChanged 而不是 LostFocus 上更新

c# - 创建一个自定义模板作为 ResourceDictionary 并从代码隐藏中访问它

.net - MVVM 模式存在哪些问题?

c# - 旋转 3D 坐标

c# - 如何将 DataContext 设置为多个类?

wpf - 尝试创建允许文本选择的 WPF 标签模板时出现格式问题

c# - 在其他程序集中加载控件时,TextBox 的样式导致异常

c# - WPF Windows 8 兼容性问题