title: Executing a method in parent user control from a child in WPF
body: <p>I have a user control named <code>Display</code> in  <code>MainWindow.xaml</code>. <code>Display</code> user control itself has a custom class <code>Workspace.cs</code> in it like this:</p>
  
  <pre><code>&lt;UserControl x:Class="Program.Main.Controls.Display.Display"
               xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
               xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
               xmlns:workspaces="clr-namespace:Program.Workspaces"&gt;
  
      &lt;Border&gt;
          &lt;Grid&gt;
              &lt;workspaces:Workspace x:Name="MyWorkspace" ClipToBounds="True"/&gt;
          &lt;/Grid&gt;
      &lt;/Border&gt;
  &lt;/UserControl&gt;
  </code></pre>
  
  <p>In my custom class that is <code>Worskspace.cs</code> I'm rising a <code>MouseLeftButtonDown</code> event, I want to execute the <code>ThisCommandCameFromWorkspace</code> method in <code>Display.xaml.cs</code> when rising this event.</p>
  
  <p>What is the best approach to do this? And What is the easiest?</p>
  
  <p><strong>Updated:</strong></p>
  
  <p>In my Workspace.cs I have</p>
  
  <pre><code>public event Action MyEventHandler;
  
  private void OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
      {
              if (MyEventHandler!= null)
                  MyEventHandler();
      }
  </code></pre>
  
  <p>Now I want to capture this in <code>Display</code> user control and execute a method of its code-behind.</p>