diff --git a/Elwig/Windows/AdministrationWindow.cs b/Elwig/Windows/AdministrationWindow.cs index 4331253..10f9ac3 100644 --- a/Elwig/Windows/AdministrationWindow.cs +++ b/Elwig/Windows/AdministrationWindow.cs @@ -427,8 +427,9 @@ namespace Elwig.Windows { } protected void TextBox_TextChanged(object sender, RoutedEventArgs? evt) { - var input = (TextBox)sender; - if (SenderIsRequired(input) && input.Text.Length == 0) { + var input = (Control)sender; + var tb = input as TextBox ?? (input as UnitTextBox)?.TextBox; + if (SenderIsRequired(input) && tb?.Text.Length == 0) { ValidateInput(input, false); ControlUtils.SetInputInvalid(input); } else { @@ -472,11 +473,13 @@ namespace Elwig.Windows { } protected void IntegerInput_TextChanged(object sender, TextChangedEventArgs evt) { - InputTextChanged((TextBox)sender, Validator.CheckInteger); + // FIXME + InputTextChanged((sender as UnitTextBox)?.TextBox ?? (TextBox)sender, Validator.CheckInteger); } protected void DecimalInput_TextChanged(object sender, TextChangedEventArgs evt) { - InputTextChanged((TextBox)sender, Validator.CheckDecimal); + // FIXME + InputTextChanged((sender as UnitTextBox)?.TextBox ?? (TextBox)sender, Validator.CheckDecimal); } protected void PartialDateInput_TextChanged(object sender, TextChangedEventArgs evt) {