开发者

WPF Masked Textbox with a value that does not contain mask

开发者 https://www.devze.com 2022-12-11 14:18 出处:网络
I need a WPF Textbox that displays a phone number as \"(555) 555-5555\" but has a value of \"5555555555\".

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 prop开发者_如何学运维erty of my view model so that the property value has the extraneous ()- characters.


How about an IValueConverter?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号