I have been beating my head against the preverbal wall trying to figure this out. I have a WPF application targeting .Net 4.5.1 using an MVVM pattern running on Windows 8.1. All I need is to switch the current culture for my application (or all of Windows) so the associated keyboard map is loaded in real-time. I have tried everything I could find on the web, but nothing works correct for what I need. The closest I came is this code:
InputLanguageManager.SetInputLanguage(AcquisitionTextBox, CultureInfo.CreateSpecificCulture(Settings.Default.CurrentCluture));
However, it does not take affect until the view is reloaded. Strangely, it sets the culture/keyboard map for all of windows when it takes effect, not just the specified Textbox.
Would someone help me out with a short example? All I need is a view with three buttons for each installed language, lets say English, Spanish and Norwegian. Arbitrarily clicking any button should switch the current culture and load the associated keyboard layout.
Thanks!
Joe
What I have tried:
InputLanguageManager.SetInputLanguage(AcquisitionTextBox, CultureInfo.CreateSpecificCulture(Settings.Default.CurrentCluture));
and
CultureInfo.DefaultThreadCurrentCulture = new CultureInfo(culture);
CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo(culture);
and
Binding to the TextBox's Language and InputLanguageManager.InputLanguage properties.
and
Everything I could find on Google...