Validating user input in C# coming from XAML controls
This is not how it should be done in WPF especially that you are not validating the text but just changing it upper case - you validate only the numeric input.

The right way would be to use the Binding Validation

This method would allow you to write specialized validators without ifs or switches.