“值不能为空"添加ThemeDictionary时发生编译器错误 [英] "Value cannot be null" Compiler Error when adding ThemeDictionary

查看:50
本文介绍了“值不能为空"添加ThemeDictionary时发生编译器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在1个解决方案中创建了2个项目,其中一个包含一些资源词典(称为MyThemes)和1个WPF应用程序.我将字典放在Themes文件夹中(将其构建操作留给Page;这是默认设置),然后在另一个项目中添加了 以下是对app.xaml的声明:

I just created 2 projects in 1 solution, one containing some resource dictionaries (called MyThemes) and 1 WPF application. I placed the dictionaries in a Themes folder (I left their build action to Page; the default), and in the other project I added the following statement to the app.xaml:


<Application.Resources>
  <ResourceDictionary>
   <ResourceDictionary.MergedDictionaries>
     <ResourceDictionary Source="{ThemeDictionary AssemblyName=MyThemes}" />
   </ResourceDictionary.MergedDictionaries>
  </ResourceDictionary>
</Application.Resources>

推荐答案

您好Stefan,

Hi Stefan,

我认为您在提到的行下面出现了一些语法错误.

I think ur doing some syntactical error in ur below mentioned line.

<ResourceDictionary Source="{ThemeDictionary AssemblyName=MyThemes}" />


这篇关于“值不能为空"添加ThemeDictionary时发生编译器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆