void RadioFrequencyOnKeyDown(object sender, KeyEventArgs keyEventArgs) { if (keyEventArgs.Key == Key.Enter) { //remove focus to somewhere else RadioVolume.Focus(); Keyboard.ClearFocus(); //then clear altogher } }
private void RadioFrequencyOnGotFocus(object sender, RoutedEventArgs routedEventArgs) { var dcsPlayerRadioInfo = _clientStateSingleton.DcsPlayerRadioInfo; if ((dcsPlayerRadioInfo == null) || !dcsPlayerRadioInfo.IsCurrent() || RadioId > dcsPlayerRadioInfo.radios.Length - 1 || RadioId < 0) { //remove focus to somewhere else RadioVolume.Focus(); Keyboard.ClearFocus(); //then clear altogether } }