-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TextBoxMask: binding problem #1228
Comments
ping @IbraheemOsama looks like, from my quick test, that the two way binding does not reflect the content of the textbox once the mask is applied |
That's great, just tested it with the fix and it seems to work as expected |
There are still some problems, I resolved by this way:
// Case change due to Text property is assigned a value (Ex Textbox.Text="value")
if (textbox.SelectionStart == 0 && textbox.FocusState == FocusState.Unfocused)
{
var displayText = textbox.GetValue(DefaultDisplayTextProperty) as string ?? string.Empty;
if (string.IsNullOrEmpty(textbox.Text))
{
textbox.Text = displayText;
}
else
{
var textboxInitialValue = textbox.Text;
textbox.Text = displayText;
SetTextBoxValue(textboxInitialValue, textbox, mask, representationDictionary, placeHolderValue[0], 0);
textbox.SetValue(OldTextProperty, textbox.Text);
}
return;
}
// Delete or backspace is triggered |
ping @IbraheemOsama |
@gpbicego what is the problems ? can you please elaborate. I you see that your code works please submit a Pull Request with your fix but describe the problem first :) |
Repro
The text was updated successfully, but these errors were encountered: