Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF MaskedTextBox value binding (binding without the mask)

This is my masked textbox from the WPF Extended Toolkit

<xctk:MaskedTextBox Mask="(000) 000-0000" Value="{Binding Number, UpdateSourceTrigger=PropertyChanged}" />

The binding back to the property is including the mask. For example, when I enter 9991114444, the Number property is set to (999) 111-4444. What I need, however, is just the value without the mask (9991114444). Can I accomplish that with the MaskedTextBox?

The number property is basic string property:

public string Number { get; set; }
like image 502
Chris Klepeis Avatar asked Jul 11 '12 17:07

Chris Klepeis


1 Answers

I believe you can just add

IncludeLiterals="False"
like image 186
Kevin DiTraglia Avatar answered Nov 08 '22 13:11

Kevin DiTraglia