I have a button in a xaml file that should be hidden in some cases.

Here it is:

```
<Button Visibility="{Binding Path=ShowMyButton}"/>

```

The binding works perfect until it comes to obfuscating my code.

In the AssemblyInfo.cs I added the following assembly annotation:

```
[assembly: ObfuscateAssemblyAttribute(false, StripAfterObfuscation = false)]

```

By the way, I use Eazfuscator.NET

After obfuscating the code the button is always visible, i.e. the bind does not work anymore.

I added the following annotation to the ShowMyButton property:

```
[ObfuscationAttribute(Exclude=true)]
public bool ShowMyButton
{
     get
     {
         return _showMe;
     }
     set
     {
         _showMe= value;
         OnPropertyChanged("ShowMyButton");
     }
}

```

This exclusion works fine, but I have 3 questions:

1. why the xaml got confused when it comes to obfuscation. can I tell the obfuscator not to obfuscate methods that refer to binding in xaml files?
2. According to msdn ObfuscateAssemblyAttribute distincts only between public and private methods. It would be very frustrating to manually exclude all methods that refer to binding in the xaml files (There are dozens in my application). Is there an automatic option?
3. Is there a way to tell the obfucator to obfuscate only specific method in the application, i.e. please do not obfuscate anything by default until i tell you to do so.