简体   繁体   English

如何在 vscode 中打开 xaml 文件?

[英]How do you open xaml files in vscode?

I created a new WPF application using the command dotnet new wpf in the Terminal.我在终端中使用命令 dotnet new wpf 创建了一个新的 WPF 应用程序。 I now have two xaml files, App.xaml and MainWindow.xaml, how do I open these files, everytime i select them they just take me to the code. I now have two xaml files, App.xaml and MainWindow.xaml, how do I open these files, everytime i select them they just take me to the code.

XAML files are XML files. XAML 文件是 XML 文件。 They are being opened by Visual Studio Code just fine.它们被 Visual Studio Code 打开就好了。

It sounds like what you are interested in, though, is working with XAML files via the XAML Designer, where you can drag and drop controls onto a design surface?不过,听起来您感兴趣的是通过 XAML 设计器使用 XAML 文件,您可以在其中将控件拖放到设计图面上?

Unfortunately, Visual Studio Code does not provide a XAML designer out of the box.不幸的是,Visual Studio Code 没有提供开箱即用的 XAML 设计器。 There are third-party tools you can use, but if you need XAML Designer support my suggestion would be to download and use Visual Studio (rather than Visual Studio Code).您可以使用第三方工具,但如果您需要 XAML Designer 支持,我的建议是下载并使用 Visual Studio(而不是 Visual Studio Code)。 The Community Edition of Visual Studio is free to use. Visual Studio 社区版可免费使用。

I would recommend that you check out this tutorial if you are planning to use XAML in vscode rather than Visual Studio如果您打算在 vscode 而不是 Visual Studio 中使用 XAML,我建议您查看本教程

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM