如何在 wpf xaml 文件中添加多行注释?

Akh*_*dan 6 .net c# wpf xaml

   <Grid Name="grid2" Grid.Row="1" Margin="10,5,10,10" TextBlock.Foreground="White">
         <Grid.RowDefinitions>
            <RowDefinition Height="100" />
            <RowDefinition Height="*" />
          </Grid.RowDefinitions>
   </Grid>
Run Code Online (Sandbox Code Playgroud)

我想评论有关 grid2 的行

Pat*_*man 6

在 XML(以及 XAML)中,多行注释和单行注释没有区别:

<!-- single line -->
Run Code Online (Sandbox Code Playgroud)

对比。

<!--
  multi
  line
-->
Run Code Online (Sandbox Code Playgroud)

为了帮助您,Visual Studio 中提供了可用的快捷方式,如其他人评论的那样:

Ctrl+ K, C: 评论

Ctrl+ K, U: 取消注释


Saj*_*ran 5

在 Visual Studio 中发表评论

选择线条,

CTRL+K +C
Run Code Online (Sandbox Code Playgroud)

取消注释

CTRL+K+U
Run Code Online (Sandbox Code Playgroud)