title: wpf command control visibility
body: <p>I have a custom command:</p>
  
  <pre><code>public static class CommandLibrary
  {
      private static RoutedUICommand cmdMyCommand = new RoutedUICommand("My command", "MyCommand", typeof(CommandLibrary));
      public static RoutedUICommand MyCommand{ get { return cmdMyCommand ; } }
  }
  </code></pre>
  
  <p>and I register a binding like this</p>
  
  <pre><code>CommandManager.RegisterClassCommandBinding(typeof(SomeClass), new CommandBinding(CommandLibrary.MyCommand, new ExecutedRoutedEventHandler(myCommandExecuteHandler), new CanExecuteRoutedEventHandler(myCommandCanExecuteHandler)));
  </code></pre>
  
  <p>And in generic.xaml I have a Buton with Command property set. The button is being properly enabled/disabled based on logic in myCommandCanExecuteHandler.</p>
  
  <p>But now I would like to also control this button's visibility (independent of CanExecute which is mapped to IsEnabled). How do I approach that problem?</p>
  
  <p>A discussion about the same problem is available here: <a href="http://social.msdn.microsoft.com/forums/en-US/wpf/thread/c20782f8-2d04-49d3-b822-f77b4b87c27a/" rel="nofollow">http://social.msdn.microsoft.com/forums/en-US/wpf/thread/c20782f8-2d04-49d3-b822-f77b4b87c27a/</a>, but somehow the idea that CanBeSeen is a property of RoutedUICommand derived class does not appeal to me.</p>