title: Double-click event fires at window level and control level, even when it is handled within the control
body: <p>I am working on a WPF application where I have a Window level double-click event that maximizes the app window when a user double-clicks anywhere within the window. However, I also have a custom control within the app window, and a separate double-click event within the custom control. When a user double-clicks in the custom control, only the control's double-click event should fire, and the window should not resize. My code looks something like this: </p>
  
  <pre><code>public class Window 
  {
      private void window_DoubleClick(object sender, EventArgs e) 
      {
          /// Maximize/minimize window
      }
  
      private void myCustomControl_DoubleClick(object sender, EventArgs e) 
      {
          /// Do other things, but PLEASE don't resize!
          e.Handled = true;
      } 
  }
  </code></pre>
  
  <p>And my XAML looks something like this:</p>
  
  <pre><code>&lt;Window x:class="MyProject.MyWindow"
       MouseDoubleClick="window_DoubleClick"&gt;
      &lt;Grid Grid.Row="0" Margin="0"&gt;
          &lt;local:myCustomControl
              MouseDoubleClick="myCustomControl_DoubleClick"/&gt;
      &lt;/Grid&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>Unfortunately, with this code in place, when the user double-clicks in the control, the control event fires, but the Window event fires as well. I have tried setting e.Handled=true in the control event, but the Window event fires anyway. The only thing that has stopped the Window level double-click event from firing is handling the custom control's preview double-click event using this:</p>
  
  <pre><code>private void myCustomControl_PreviewMouseDoubleClick(object sender, MouseButtonEventArgs e) 
  {
      e.Handled = true;
  }
  </code></pre>
  
  <p>Though the preview event stops the Window double-click before it can fire, I can't use it without having to refactor a good bit of code. My custom control has a few child controls that also handle its double-click event. If the preview event gets called at the parent control level, the double-click event never tunnels down through the child controls, and thus double-clicking doesn't do what I want it to do. If possible, I would like to avoid having to refactor any of the code in the child controls. That being said, my question is this: Is there any way to stop the Window-level double-click event from firing once the control's double-click event has been handled? I've been driving myself crazy trying to figure this out.. any help is appreciated! </p>