示例#1
0
        private void MenuItem_Checked_Area(object sender, RoutedEventArgs e)
        {
            var AreaMenuItem = (sender as MenuItem).Parent as MenuItem;

            foreach (MenuItem item in AreaMenuItem.Items)
            {
                if (item.Header != (sender as MenuItem).Header)
                {
                    item.IsChecked = false;
                }
            }
            if (((string)(sender as MenuItem).Header) == "הכל")
            {
                MainListBox.ItemsSource = Requests;
                return;
            }

            BO.Location selectedLocation = (BO.Location)MyDictionary.TranslatStringeToEnum((string)(sender as MenuItem).Header);
            MainListBox.ItemsSource = from Group in bl.GuestRequestGroupedBySpecificArea()
                                      where Group.Key == selectedLocation
                                      select Group into items
                                      from guestRequest in items
                                      where guestRequest.ClientID != hostID
                                      select guestRequest;
        }