Hi peeps,

You probably know the common issue with the decimal seprator. Depending on the country, the keyboard or what your client wants (which can be variable…), the separator will be a coma or a dot (or even something else…).

In my case, the Culture is “en-US“, on a Belgian keyboard where the decimal separator should be a coma. No worries, these parameters can be changed easily.

First of all, set the CultureInfo globally for your application (in the code behind of your MainView or in my case in the MainVM.cs).

Adapt the NumberDecimalSeparator and/or the DateSeparator here as well.

In the View, you can now adapt the TextBox to have something like:

PreviewTextInput is an event that will be raised when you enter a new character inside the TextBox.

Now in the code behind of your View, just add this method:

Adapt if needed of course…

Happy coding!  🙂