Change InputLanguage doen't work WPF

2k Views Asked by At

I've problem with OSK in WPF. I change the InputLanauage by InputLanguageManager like this:

InputLanguageManager.SetInputLanguage(_targetKeyboardWindow, CultureInfo.CreateSpecificCulture("ru"));

But it doesn't work. I need to change the actual view of my application (by click back button) and then my changes in InputLanguageManager starts to work. But when I tried to change View from code-behind after I change input language - it does not work.

Moreover, in debugger I can see that after changing language, the current language is still default (previous)

Any idea?

1

There are 1 best solutions below

0
On BEST ANSWER

Ok, the solution is trivial .

Instead of:

InputLanguageManager.SetInputLanguage(_targetKeyboardWindow, CultureInfo.CreateSpecificCulture("ru"));

use:

InputLanguageManager.Current.CurrentInputLanguage = new CultureInfo("ru");

Best regards.