I used this syntax as I found online but it throws an error:
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" <!-- Cool comment --> xmlns:System="clr-namespace:System;assembly=mscorlib"
'Name cannot begin with the '<' character, hexadecimal value 0x3C. Line 4, position 5.' XML is not valid.
Just right click the project, choose Add -> Window and that will add a new xaml file along with its corresponding .
If you are using Eclipse IDE you can comment out lines in an XML file by highlighting them and press Ctrl+Shift+c.
You can add comments to the XAML code that's in the MainWindow. xaml tab in the following ways: Enter <! -- before a comment and then add --> after the comment.
I assume those XAML namespace declarations are in the parent tag of your control? You can't put comments inside of another tag. Other than that, the syntax you're using is correct.
<UserControl xmlns="..."> <!-- Here's a valid comment. Notice it's outside the <UserControl> tag's braces --> [..snip..] </UserControl>
Found a nice solution by Laurent Bugnion, it can look something like this:
<UserControl xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:comment="Tag to add comments" mc:Ignorable="d comment" d:DesignHeight="300" d:DesignWidth="300"> <Grid> <Button Width="100" comment:Width="example comment on Width, will be ignored......"> </Button> </Grid> </UserControl>
Here's the link: http://blog.galasoft.ch/posts/2010/02/quick-tip-commenting-out-properties-in-xaml/
A commenter on the link provided extra characters for the ignore prefix in lieu of highlighting:
mc:Ignorable=”ØignoreØ”
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