'Window' 类型不支持直接内容 [英] The type 'Window' does not support direct content

查看:163
本文介绍了'Window' 类型不支持直接内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用 VS 2015 构建的 WPF 解决方案,由几个项目组成.突然间,我开始在设计模式下收到一条警告,内容如下:

I have a WPF solution built with VS 2015 composed of several projects. Suddenly I started receiving a warning in design mode stating the following:

窗口"类型不支持直接内容.

The type 'Window' does not support direct content.

我理解有些控件不支持直接内容,但 System.Windows.Window 应该支持.我在使用 UserControl 时收到相同的警告,据我所知,任何其他通常支持直接内容的控件也收到了相同的警告.

I understand how some controls do not support direct content, but System.Windows.Window should. I get the same warning with UserControl, and as far as I know, any other control that typically supports direct content.

一切都可以编译并运行良好,但在我的所有 XAML 中都带有蓝色下划线很麻烦.有没有其他人遇到过这种情况?

Everything compiles and runs fine, but having the blue underlines through all of my XAML is bothersome. Has anyone else come across this?

以下是截图:

推荐答案

确保您引用 System.Xaml.清理并重建项目.适用于 VS 2015 更新 1.

Make sure you reference System.Xaml. Clean and rebuild the project. Works on VS 2015 Update 1.

这篇关于'Window' 类型不支持直接内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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