示例#1
0
 private void chkAll_Loaded(object sender, RoutedEventArgs e)
 {
     chkAll = sender as CheckBox;
     if (this.ExamPlaceItemsSource != null)
     {
         chkAll.IsChecked = ExamPlaceItemsSource.Any(item => item.IsChecked);
     }
 }
示例#2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            int checkcount = ExamPlaceItemsSource.Count(r => r.IsChecked == true);

            if (checkcount == 0)
            {
                MessageBox.Show("请选择考点", "消息提示", MessageBoxButton.OK);
                return;
            }
            ExamPlace[] selectExamPlaces = ExamPlaceItemsSource.Where(o => o.IsChecked == true).ToArray();
            if (OnGetDataEvent != null)
            {
                OnGetDataEvent(selectExamPlaces);
            }
            this.Close();
        }
示例#3
0
 private void chkCell_Click(object sender, RoutedEventArgs e)
 {
     if (ExamPlaceItemsSource != null)
     {
         int checkcount = ExamPlaceItemsSource.Count(r => r.IsChecked == true);
         if (checkcount == ExamPlaceItemsSource.Length)
         {
             chkAll.IsChecked = true;
         }
         else if (checkcount == 0)
         {
             chkAll.IsChecked = false;
         }
         else
         {
             chkAll.IsChecked = null;
         }
     }
 }