title: How to bind to a MenuItems Property from Control to another MenuItem in Parent View?
body: <p>I got the following View of type MyCustomView:</p>
  
  <pre><code>&lt;Grid&gt;
  ...
  &lt;usercontrols:MyUsercontrol&gt;
     &lt;usercontrols:MyUsercontrol.ContextMenu&gt;
         &lt;ContextMenu&gt;
             &lt;ContextMenu.ItemsSource&gt;
                 &lt;CompositeCollection&gt;
                      &lt;MenuItem IsEnabled="{Binding HOW_TO_BIND_TO_miTest}" Header="Test" Click="DoSomeAction" /&gt;
                 &lt;/CompositeCollection&gt;
             &lt;/ContextMenu.ItemsSource&gt;
          &lt;/ContextMenu&gt;
     &lt;/usercontrols:MyUsercontrol.ContextMenu&gt;
   &lt;/usercontrols:MyUsercontrol&gt;
  
  ...
  
  &lt;Button Style="{StaticResource SidebarButton}" Click="OpenContextMenu" Content="Open Menu"&gt;
     &lt;Button.ContextMenu&gt;
        &lt;ContextMenu&gt;
            &lt;ContextMenu.ItemsSource&gt;
                &lt;CompositeCollection&gt;
                   &lt;MenuItem x:Name="miTest" Header="Add Account" Click="DoSomeAction"/&gt;
                &lt;/CompositeCollection&gt;
             &lt;/ContextMenu.ItemsSource&gt;
         &lt;/ContextMenu&gt;
     &lt;/Button.ContextMenu&gt;
  &lt;/Button&gt;
  
  ...
  &lt;/Grid&gt;
  </code></pre>
  
  <p>In the Code-Behind of the View I set the IsEnabled-Property of MenuItem "miTest" to false, so the MenuItem is disabled. How do I synchronise this with the IsEnabled-Property of the embedded UserControls' Contextmenu-Item? I already tried this one:</p>
  
  <pre><code>&lt;MenuItem IsEnabled="{Binding Path=Test_binding.IsEnabled, RelativeSource={RelativeSource AncestorType={x:Type MyCustomView}}}" Header="Test" Click="DoSomeAction" /&gt;
  </code></pre>
  
  <p>and added this Code-Behind:</p>
  
  <pre><code>    public MenuItem Test_binding
      {
          get { return this.miTest; }
      }
  </code></pre>
  
  <p>but this is not working.</p>