private void RangeDatePicker_SelectedDateChanged(object sender, SelectionChangedEventArgs e) { if (EndDatePicker == null || StartDatePicker == null) { return; } if (StartDatePicker.SelectedDate != null && EndDatePicker.SelectedDate != null) { if (StartDatePicker.SelectedDate > EndDatePicker.SelectedDate) { DatePicker dataPicker = sender as DatePicker; switch (dataPicker.Name) { case "StartDatePicker": StartDatePicker.SelectedDate = EndDatePicker.SelectedDate; //MessageBox.Show("请选择合法的日期范围值!"); break; case "EndDatePicker": EndDatePicker.SelectedDate = StartDatePicker.SelectedDate; //MessageBox.Show("请选择合法的日期范围值!"); break; } } } AlgorithmClass.CollectionViewSource_Refresh(this, "ViewSource"); CountCurViewPrice(); }
private void TextBox_TextChanged(object sender, TextChangedEventArgs e) { AlgorithmClass.CollectionViewSource_Refresh(this, "ViewSource"); CountCurViewPrice(); }