Example #1
0
 private void AssociatedObject_PreviewMouseDown(object sender, MouseButtonEventArgs e)
 {
     if (e.LeftButton == MouseButtonState.Pressed)
     {
         var parent = WPFUtil.FindLogicalAncestor(AssociatedObject);
         if (parent != null && parent is MenuItem mi)
         {
             mi.IsSubmenuOpen = false;
         }
     }
 }