当我尝试引用我的 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>
Error
An Error occurred while finding the resource dictionary "pack://application:,,,/Dashboard.Designer.WPF;Connection/Views/test.xaml"
参考图片 https://i.stack.imgur.com/CIbjR.png
怎么解决这个问题。?
Your 资源文件包 URI https://learn.microsoft.com/en-us/dotnet/framework/wpf/app-development/pack-uris-in-wpf#resource-file-pack-uris是错的。
它应该看起来像这样,包括component
part:
pack://application:,,,/Dashboard.Designer.WPF;component/Connection/Views/test.xaml
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)