Intellisense for XAML Files (Xamarin.Forms)

試著忘記壹切 提交于 2019-12-06 10:53:14

问题


In Visual Studio 15, how do I get XAML Intellisense working for XAML files in Xamarin.Forms?

Edit: Split answer from the question


回答1:


This solution was found on this forum by dzCepheus.

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).

The two lines of code being:

<Schema href="%VsInstallDir%/xml/schemas/xaml2006.xsd"
targetNamespace="http://schemas.microsoft.com/winfx/2006/xaml/presentation" />

NOTE: for me, "%VsInstallRoot%" worked, not "%VsInstallDir". It probably depends on the VS version.

and

<Association extension="xaml" schema="%InstallDir%/xml/schemas/xaml2006.xsd" />

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.



来源:https://stackoverflow.com/questions/41944444/intellisense-for-xaml-files-xamarin-forms

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!