using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Controls; namespace Microsoft.Research.DynamicDataDisplay.Common.Auxiliary { internal static class MenuItemExtensions { public static MenuItem FindChildByHeader(this MenuItem parent, string header) { return parent.Items.OfType().Where(subMenu => (string)subMenu.Header == header).FirstOrDefault(); } } }