Open phanthanhdat077 opened 1 month ago
@phanthanhdat077 Can it work well with other IME?
I can not repro your issues with Microsoft Pinyin.
I don't know too I don't use Microsoft Pinyin (I tried to use Microsoft Pinyin it can type numbers and binding to my Text but Vietnamese Telex still can not binding). Do you have any suggestions to fix it with Vietnamese Telex? My way is not to use Vietnamese telex again
@phanthanhdat077 Can it work well with other IME?
I can not repro your issues with Microsoft Pinyin.
@phanthanhdat077 Sorry, I don't know anything about Vietnamese Telex right now
If it helps to investigate, note that Vietnamese Telex is IME. The view model property is not getting updated until the composition is committed. It does seem to be reflected in the TextBox.Text property though on every TextChanged event.
@miloush What I'm confused about is why is the TextChanged event triggered but the Text is empty.
As I said, the databinding does not update the Text property. The Text is only empty on the viewmodel, not on the TextBox. I would guess that the composition events do not change the TextBox.Text property in a way that a databinding with PropertyChanged trigger would pick it up.
As I said, the databinding does not update the Text property. The Text is only empty on the viewmodel, not on the TextBox. I would guess that the composition events do not change the TextBox.Text property in a way that a databinding with PropertyChanged trigger would pick it up.
yes, TextBox.Text still received the text I just can not binding to ViewModel.
Your viewmodel will get the text once the input is committed, e.g. after typing a space. This applies to all similar IMEs, not only Vietnamese Telex. It does feel like a bug that the TextBox is firing TextChanged but not the DP value change. I am a bit busy at the moment to have a closer look, perhaps others can give it a go.
my problem: I using Textbox for typing only numbers and can't space that method for payment it has the event TxtInputMoney_PreviewTextInput to handle for type only numbers but when I turn on Vietnamese Telex it can overcome the event TxtInputMoney_PreviewTextInput and type the word.
private void TxtInputMoney_PreviewTextInput(object sender, TextCompositionEventArgs e) { Regex regex = new Regex("[^0-9]+"); e.Handled = regex.IsMatch(e.Text); }
I can not binding to Text from TextBox my Text property always empty when I using VIE Vietnamese Telex from Keyboard layout Win 11![image](https://github.com/dotnet/wpf/assets/34691283/0179fdf4-d997-4945-8806-f798de862e43)
WpfApp14.zip