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
            }
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            Console.WriteLine("Radio is on - what do you want to do?");

            RadioFrequency radiovolume = new RadioVolume();
            radiovolume.Volume = Console.Read();
            Console.WriteLine("Volume is {0}", radiovolume.Volume);

            RadioFrequency radiofrequency = new RadioFrequency();
            radiofrequency.Frequency = Console.Read();
            Console.WriteLine("Frequency is {0}", radiofrequency.Frequency);
        }