private void MenuItem_Checked(object sender, RoutedEventArgs e) { MenuItem menuItem = sender as MenuItem; MenuItem item = menuItem.Parent as MenuItem; //foreach (var i in item) //{ // if () // { // } //} if ((string)menuItem.Header == "ירושלים") { UnitsViewList.ItemsSource = from Group in bl.GetGroupHostingUnitsByArea() where Group.Key == Areas.ירושלים select Group into g from GR in g select GR; } if ((string)menuItem.Header == "צפון") { UnitsViewList.ItemsSource = from Group in bl.GetGroupHostingUnitsByArea() where Group.Key == Areas.צפון select Group into g from GR in g select GR; } if ((string)menuItem.Header == "דרום") { UnitsViewList.ItemsSource = from Group in bl.GetGroupHostingUnitsByArea() where Group.Key == Areas.דרום select Group into g from GR in g select GR; } if ((string)menuItem.Header == "מרכז") { UnitsViewList.ItemsSource = from Group in bl.GetGroupHostingUnitsByArea() where Group.Key == Areas.מרכז select Group into g from GR in g select GR; } if ((string)menuItem.Header == "הכל") { UnitsViewList.ItemsSource = bl.GetAllHostingUnits().ToList(); } }