After some research following the very wise suggestion from Stewbob, I decided to only allow the user to input the current culture decimal separator. For that, I listen to PreviewTextInput
in code behind.
The effect is that the user can only type numbers, then the current decimal separator once, then more numbers. Other characters simply "don't respond". We think this is fair usability-wise.
private void PreviewNumberInput(object sender,
System.Windows.Input.TextCompositionEventArgs e) {
string input = ((TextBox)sender).Text + e.Text;
string pattern = "^[0-9]+[" +
Thread.CurrentThread.CurrentUICulture.NumberFormat.NumberDecimalSeparator +
"]?([0-9]+)?$";
Regex regex = new Regex(pattern);
e.Handled = !regex.IsMatch(input);
}