title: How to bind data to a control's Visibility property
body: <p>I understand that the <code>Visibility</code> property of a control cannot be bound to data in the same way that other properties can. It needs some kind of converter(?). In trying to implement the solution from <a href="https://stackoverflow.com/questions/10479490/how-to-bind-visibility-property-in-wpf">this question</a> I run into a compiler error that says: <code>The resource "BoolToVisible" could not be resolved</code>. I'm guessing that I have to create a <code>ResourceKey</code> named <code>BoolToVisible</code>, I just don't know how.</p>
  
  <p>I'm requesting that someone show me the right way to Bind to the Visibility property of a control.</p>
  
  <p>*The control that I am adding this to is a radio button.
  * I have a <code>bool</code> property for <code>isVisible</code> in my Data Model that will be bound to this radio button.</p>
  
  <p>Data Model Property:</p>
  
  <pre><code>private bool _isVisible = true;
  
  public bool IsVisible
  {
         get { return _isVisible; }
         set
         {
             _isVisible = value;
             NotifyPropertyChange(() =&gt; IsVisible);
         }
  }
  </code></pre>
  
  <p>XAML:</p>
  
  <pre><code>&lt;RadioButton Visibility="{Binding DataModel.IsVisible,Converter={StaticResource ResourceKey=BoolToVisible},RelativeSource={RelativeSource TemplatedParent}}" ... /&gt;
  </code></pre>
  
  <p>Thank you.</p>