I am fairly new to WPF and using XAML. I get really frustrated that I can not select a chunk of XAML and comment it out in Visual Studio 2010 using the comment button in the toolbar if the highlighted section already includes some comments.
Other languages allow you to nest comments inside of comments with no issue. Is there a way to comment out a comment in XAML using Visual Studio 2010?
If you are using Eclipse IDE you can comment out lines in an XML file by highlighting them and press Ctrl+Shift+c.
Try Ctrl + K, Ctrl + C. On windows, this is the shortcut for commenting code both for C# and XAML.
No, there is no way of having nested comments in XAML.
You could use the mc:Ignorable attribute on your root element, and any attribute or element prefixed with that value will be ignored E.g:
<UserControl ... mc:Ignorable="i"> <!-- Ignore Text attribute --> <TextBlock i:Text="Hello" /> <!-- Ignore entire button --> <i:Button> </i:Button> </UserControl>
Note that blend sets the mc:Ignorable attributes value to 'd', so you'll need to use e.g. mc:Ignorable="d i"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With