private void OnLanguageChanged(object o) { var language = (Language) o; _selectedSwitcheroo = null; ChangeKeyboard(language.ISO2Code); if (_langPopup.IsOpen) _langPopup.IsOpen = false; }
private string HandleSwitcherooKey(VKey key) { string switcherooCode = key.SwitcherooCode; //switch the layout ... switcherooCode = key.IsPressed ? switcherooCode : SelectedKeyboard.DefaultSwitcheroo; //unlock the key if it is locked SetLockStatus(key,false); if (_selectedSwitcheroo == null || _selectedSwitcheroo.Name != switcherooCode) { Switcheroo switcheroo = SelectedKeyboard.Switcheroos.First(s => s.Name == switcherooCode); //we switched the layout so reset the page index _currentPageIndex = 0; //enable the keys with page action next, and disable the previous List<VKey> pageKeys = switcheroo.KeyCollection.FindAll(vkey => null != vkey.PageAction); foreach (VKey item in pageKeys) { item.IsEnabled = item.PageAction == "next"; } _selectedSwitcheroo = switcheroo; } //update the modifier key status return switcherooCode; }