title: WPF bind visibility of element to another element with attached property of specifc value
body: <p>I have the following xaml code:</p>
  
  <pre><code>&lt;Window.Resources&gt;
      &lt;BooleanToVisibilityConverter x:Key="b2v" /&gt;
  &lt;/Window.Resources&gt;
  </code></pre>
  
  <p>I would like to bind the visibility of a RichTextBox to the check state of a CheckBox.</p>
  
  <pre><code>&lt;RichTextBox Visibility="{Binding IsChecked,ElementName=chk,Converter={StaticResource b2v}}" /&gt;
  </code></pre>
  
  <p>No problem so far. But the problem is that my CheckBox has no Name property (I can't give it a name because it is copied over time).</p>
  
  <p>Due to that I have an attached property for the CheckBox</p>
  
  <pre><code>&lt;CheckBox local:MyUIElementAttributes.AttachedElementType="TitleCheckbox"/&gt;
  </code></pre>
  
  <p>Now I would like to use this attached property to identify the CheckBox that the visibility of my RichTextBox is to be bound to.</p>
  
  <p>How can I do that? I have to bind to the attached property and have to check the value of that to set the visibility.</p>
  
  <p>Thank you!</p>