private void FillPreviousFind(FindHandler.FindDescription findDescription)
        {
            comboBoxField.SelectedItem = findDescription.field;
            if (findDescription.isDate)
            {
                datePicker.SelectedDate = Convert.ToDateTime(findDescription.value);
            }
            else
            {
                textBoxValue.Text = findDescription.value;
            }

            textBoxValue.Visibility = findDescription.isDate ? Visibility.Hidden : Visibility.Visible;
            datePicker.Visibility   = findDescription.isDate ? Visibility.Visible : Visibility.Hidden;

            // Фишка - минутка
            radioButtonExact.IsEnabled = !(isNowNumber || isNowTime);
            radioButtonPart.IsEnabled  = !(isNowNumber || isNowTime);
            //
            if (!radioButtonExact.IsEnabled)
            {
                radioButtonExact.IsChecked = true;
            }
            else
            {
                radioButtonExact.IsChecked = findDescription.typeOfFind == TypeOfFind.TypesOfFind.byExactCoincidence;
                radioButtonPart.IsChecked  = !(findDescription.typeOfFind == TypeOfFind.TypesOfFind.byExactCoincidence);
            }
        }
 public FindWindow(FindHandler.FindDescription findDescription, List <FindHandler.FieldParameters> listOfFields = null)
 {
     InitializeComponent();
     this.listOfFields       = listOfFields;
     datePicker.Visibility   = findDescription.isDate ? Visibility.Visible : Visibility.Hidden;
     textBoxValue.Visibility = findDescription.isDate ? Visibility.Hidden : Visibility.Visible;
     isNowTime            = findDescription.isDate;
     isNowNumber          = findDescription.isNumber;
     this.findDescription = findDescription;
 }
        private void ButtonSearch_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = true;
            FindHandler.FindDescription result = new FindHandler.FindDescription();
            result.field      = comboBoxField.SelectedItem.ToString();
            result.typeOfFind = radioButtonExact.IsChecked.Value ? TypeOfFind.TypesOfFind.byExactCoincidence : TypeOfFind.TypesOfFind.byPart;
            result.value      = isNowTime ? datePicker.SelectedDate.Value.ToShortDateString() : textBoxValue.Text;
            result.isDate     = isNowTime;
            Result            = result;

            Close();
        }