Is t...">

XML Commenting

Consider this XML fragment:

<ListBox x:Name="pictureBox"
                ItemsSource="{Binding}"
                 MouseDoubleClick="item_DoubleClick"
>

Is there any way to comment MouseDoubleClick="item_DoubleClick"? This attempt fails:

<ListBox x:Name="pictureBox"
                ItemsSource="{Binding}"
                <!-- MouseDoubleClick="item_DoubleClick"-->
>
+3
source share
2 answers

You can just comment on the whole element that will work, and put a modified version under it without this attribute.

+3
source

No, you do not have to delete it. You cannot comment inside an element declaration. The parser would not be able to parse this XML at all because of the extra "<", enter the public declaration of the ListBox element.

+3
source

All Articles