问题描述
在Visual Studio 15中,如何使XAML Intellisense适用于Xamarin.Forms中的XAML文件?
In Visual Studio 15, how do I get XAML Intellisense working for XAML files in Xamarin.Forms?
从问题中拆分答案
推荐答案
此解决方案位于此论坛.
要解决此问题,请将以下两行代码附加到catalog.xml
的底部,该位置应位于C:\Program Files (x86)\Microsoft Visual Studio 14.0\Xml\Schemas
(这取决于Visual Studio的本地安装目录).
To resolve the problem, append the following 2 lines of code to the bottom of catalog.xml
, which should be located at C:\Program Files (x86)\Microsoft Visual Studio 14.0\Xml\Schemas
(this depends on your local installation directory for visual studio).
两行代码是:
<Schema href="%VsInstallDir%/xml/schemas/xaml2006.xsd"
targetNamespace="http://schemas.microsoft.com/winfx/2006/xaml/presentation" />
注意:对我来说,%VsInstallRoot%"有效,而不是%VsInstallDir".这可能取决于VS版本.
NOTE: for me, "%VsInstallRoot%" worked, not "%VsInstallDir". It probably depends on the VS version.
和
<Association extension="xaml" schema="%InstallDir%/xml/schemas/xaml2006.xsd" />
重新启动Visual Studio之后,您将具有IntelliSense和自动完成+自动填充功能,但是如果问题仍然存在,请确保已将源代码(文本)编辑器"设置为XAML文件的默认编辑器.
After restarting Visual Studio, you will have IntelliSense and auto-complete + auto-fill working, but if the problem still occurs, make sure you have set "Source Code (Text) Editor" as Default Editor for the XAML file.
这篇关于XAML文件的智能感知(Xamarin.Forms)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!