我刚得到VS2013,并打开了VS2010项目。但是现在我看不到任何xaml设计。问题是未应用样式:
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Themes/Colors.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
给我错误:
错误1查找资源词典“ /Themes/Colors.xaml”时发生错误。
这在VS2010中可以正常工作。构建选项设置为Page。所有目标框架均设置为.NET 4。
目录结构是这样的:
Host\Themes\Colors.xaml
Plugins\EqPlugin\Source\ProblemFile.xaml
主题在VEParameters项目中定义,并声明了以下内容:
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:EQPlugin;assembly=VEParameterTool">
发生错误的文件在EqPlugIn目录中,并声明为:
<UserControl x:Class="EQPlugin.EQControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:src="clr-namespace:VEParameterTool;assembly=VEParameterTool"
xmlns:l="clr-namespace:EQPlugin"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:oxy="http://oxyplot.codeplex.com"
mc:Ignorable="d">
我曾尝试将路径更改为相对路径,但这不起作用,我已删除并重新添加了程序集,已重新启动等,所有项目均针对同一框架构建。我不知道还能尝试什么。
尝试以下一个,提供程序集名称,即使它在同一程序集中
Source="pack://application:,,,/<assemblyName>;component/Themes/Colors.xaml"
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句