Question

I need a WPF Textbox that displays a phone number as "(555) 555-5555" but has a value of "5555555555".

All of the examples I'm seeing have the ability to mask the control on the UI but that affects the bound property of my view model so that the property value has the extraneous ()- characters.

Was it helpful?

Solution

How about an IValueConverter?

OTHER TIPS

I am thinking that you will probably have to roll-your-own. It shouldn't be too difficult, subclass and override to obtain the results you are looking for.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top