In our WPF application, there are several textboxes where users ought to input only currency. It's easy to force the textbox to format the input as it goes in:
<TextBox Text="{Binding CostOut, StringFormat='{}{0:C}' />
However, this formats so quickly that it causes unexpected effects to the user as the text is type, because the numbers before and after the decimal seem to be treated almost as separate fields.
To counter this, we added a delay:
<TextBox Text="{Binding CostOut, StringFormat='{}{0:C}', Delay=1000 />
Which worked better as most people had finished typing before their numbers got formatted. However, the application is complex and deals with important financial data, and some users think carefully about the numbers as they're typed. For these slow typers, this delay still caused their input to get reformatted mid-type.
I'm unwilling to go further down the "delay" route as we'll eventually get to a point where it doesn't get formatted before someone saves. I found and tried a WPF CurrencyTextBox which was rejected as a solution because the "cash register" style typing was too unfamiliar.
Currently the proposed solution is to remove all formatting from the application and format only on save. This feels drastic to me, and I can't help wondering if there's a better solution?