I've got an Extended WPF Toolkit's MaskedTextBox control on a user control, that's bound to an int. The value of the int cannot exceed two digits but can be just one digit, which is why I'm using a MaskedTextBox. But we're having a problem displaying this control when creating a new record. Currently, when creating a new record, it displays "00". We only want it to display a single zero, like "_0". I've been following the description for the MaskedTextBox from its GitHub page. This is my first attempt:
<tk:MaskedTextBox x:Name="MaxProficienciesMaskedTextBox"
Style="{StaticResource LeftAlignMaskedTextBoxStyle}"
Value="{Binding MaxProficiencies}"
Mask="#0"
ValueDataType="{x:Type System:Int32}"
IsEnabled="{Binding IsMaxProficienciesEnabled}" />
I thought, by looking at the GitHub page, that it would give me "_0". It doesn't, it displays "00" for a new record. Likewise, I've tried a mask value of "00" and "90". Both displayed "00" for a new record.
Is it possible to display a new record with "_0"? If so, how?
You could always handle the
TextChangedevent:XAML: