user181813
user181813

Reputation: 1891

Commenting out XML

Consider this piece of XML:

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

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

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

Upvotes: 3

Views: 1710

Answers (2)

mdm
mdm

Reputation: 12630

You could just comment out the whole element, which would work, and underneath it put the modified version without that attribute.

Upvotes: 3

Chris
Chris

Reputation: 7853

No it's not you'll have to remove it. You cannot have comments inside the declaration of an Element. It would not be possible for the parser to parse this XML at all because of the additional "<" sign inside the open declaration of ListBox Element.

Upvotes: 3

Related Questions