Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change InputLanguage doen't work WPF

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?

like image 632
Mateusz Dembski Avatar asked Jul 26 '26 19:07

Mateusz Dembski


1 Answers

Ok, the solution is trivial .

Instead of:

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

use:

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

Best regards.

like image 160
Mateusz Dembski Avatar answered Jul 28 '26 08:07

Mateusz Dembski