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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24628536/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-13 12:05:56  来源:igfitidea点击:

how to add multiple line commenting in wpf xaml file?

c#.netwpfxaml

提问by Akhil Sivanandan

   <Grid Name="grid2" Grid.Row="1" Margin="10,5,10,10" TextBlock.Foreground="White">
         <Grid.RowDefinitions>
            <RowDefinition Height="100" />
            <RowDefinition Height="*" />
          </Grid.RowDefinitions>
   </Grid>

I want to comment the lines regarding grid2

我想评论有关 grid2 的行

采纳答案by Sajeetharan

To comment in Visual Studio

在 Visual Studio 中发表评论

Select the lines,

选择线条,

CTRL+K +C

UNcomment

取消评论

CTRL+K+U

回答by Patrick Hofman

There is no difference in XML (and thus XAML) between multi-line and single-line commenting:

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

<!-- single line -->

Vs.

对比

<!--
  multi
  line
-->

To help you there are shortcuts available in Visual Studio, like commented by others:

为了帮助您,Visual Studio 中提供了一些快捷方式,例如其他人的评论:

Ctrl+K,C: Comment

Ctrl+K,U: Uncomment

Ctrl+ K, C: 评论

Ctrl+ K, U: 取消注释