Change ComboBox border color
This commit is contained in:
@ -114,6 +114,8 @@ namespace WGneu.Windows {
|
||||
EntryDateInput.Text = DateTime.Now.ToString("dd.MM.yyyy");
|
||||
if (Context.Branches.Count() == 1)
|
||||
BranchInput.SelectedItem = Context.Branches.First();
|
||||
ActiveInput.IsChecked = true;
|
||||
ContactPostInput.IsChecked = true;
|
||||
FillOriginalValues();
|
||||
}
|
||||
|
||||
@ -420,8 +422,11 @@ namespace WGneu.Windows {
|
||||
tb.Text = " ";
|
||||
tb.Text = "";
|
||||
}
|
||||
foreach (var cb in Utils.FindVisualChilds<ComboBox>(this, ExemptInputs))
|
||||
foreach (var cb in Utils.FindVisualChilds<ComboBox>(this, ExemptInputs)) {
|
||||
cb.SelectedItem = null;
|
||||
if (cb.ItemsSource != null)
|
||||
Utils.SetInputInvalid(cb);
|
||||
}
|
||||
foreach (var cb in Utils.FindVisualChilds<CheckBox>(this, ExemptInputs))
|
||||
cb.IsChecked = false;
|
||||
foreach (var rb in Utils.FindVisualChilds<RadioButton>(this, ExemptInputs))
|
||||
@ -472,6 +477,11 @@ namespace WGneu.Windows {
|
||||
ortInput.ItemsSource = null;
|
||||
}
|
||||
ortInput.SelectedItem = null;
|
||||
if (ortInput.ItemsSource != null) {
|
||||
Utils.SetInputInvalid(ortInput);
|
||||
} else {
|
||||
Utils.ClearInputState(ortInput);
|
||||
}
|
||||
Valid[plzInput] = optional || (ortInput.ItemsSource != null);
|
||||
UpdateButtons();
|
||||
}
|
||||
@ -545,8 +555,9 @@ namespace WGneu.Windows {
|
||||
|
||||
private void ComboBox_SelectionChanged(object sender, RoutedEventArgs evt) {
|
||||
var input = (ComboBox)sender;
|
||||
if (InputHasChanged(input)) {
|
||||
// TODO not working
|
||||
if (input.ItemsSource != null && input.SelectedItem == null) {
|
||||
Utils.SetInputInvalid(input);
|
||||
} else if (InputHasChanged(input)) {
|
||||
Utils.SetInputChanged(input);
|
||||
} else {
|
||||
Utils.ClearInputState(input);
|
||||
|
Reference in New Issue
Block a user