This has been bothering me for a while, maybe I am missing something.
The following throws an error with the commented attribute (expected >), but shouldn't I be able to do something like this?
<Label x:Name="Gaga" FontSize="20" <!-- Content="{Binding SomethingThatIsEmptyAtDesignTime"} --> Content="LookAtMe!" />
If you are using Eclipse IDE you can comment out lines in an XML file by highlighting them and press Ctrl+Shift+c.
Attribute syntax is the XAML markup syntax that sets a value for a property by declaring an attribute on an existing object element. The attribute name must match the CLR member name of the property of the class that backs the relevant object element.
Though you can't comment out using the basic XAML markup, you can achieve the desired results by importing the Open XML markup namespace.
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:ignore="http://www.galasoft.ch/ignore" mc:Ignorable="ignore" <Label x:Name="Gaga" FontSize="20" ignore:Content="{Binding SomethingThatIsEmptyAtDesignTime}" Content="LookAtMe!" />
This blog post describes how to do it.
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