开发者

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_Dou开发者_Go百科bleClick"-->
>


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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜