MaskedTextInput with Mask="(###)-###-####" and EmptyContent="Type digits" , type a single digit, for example 6 in the control.
Value becomes 6 and Text becomes '(6__)-___-____'.
Mask is changed runtime to empty string (runtime) and the focus is out of the MaskedInput the control.
Value continues to be 6 but Text becomes '6' according to the new MASK.
EmptyContent string is shown, although Text is 6.
Expected: Text is shown in the control '6'.
Same issue in NumericInput and CurrencyInput.
=======================================
=======================================
The following workaround could be considered.
public class CustomTextInput : RadMaskedTextInput
{
protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
{
if (e.Property.Name == "Mask")
{
if (e.NewValue.ToString() == string.Empty)
{
this.LiteralPositions.Clear();
}
}
base.OnPropertyChanged(e);
}
}