/// <summary>
        /// Callback method called when an activation focus changed event has
        /// been received from the EyeX Engine for the interactor associated
        /// with this FrameworkElement.
        /// </summary>
        /// <param name="sender">The <see cref="FrameworkElement"/> that got the event.</param>
        /// <param name="e">The <see cref="ActivationFocusChangedEventArgs"/> for the event.</param>
        private static void OnActivationFocusChanged(object sender, ActivationFocusChangedEventArgs e)
        {
            var element = sender as FrameworkElement;

            if (null == element)
            {
                return;
            }

            element.SetActivationFocus(e.Focus);
            element.RaiseEvent(new RoutedEventArgs(ActivationFocusChangedEvent, element));
        }
Пример #2
0
        private void ActivationFocusChangedHandler(object sender,
                                                   ActivationFocusChangedEventArgs activationFocusChangedEventArgs)
        {
            var button = sender as Button;

            Debug.Assert(button != null);

            Console.WriteLine();
            Console.WriteLine("Button {0}", button.Name);
            Console.WriteLine("Has activation focus = {0}",
                              activationFocusChangedEventArgs.Focus == ActivationFocus.HasActivationFocus);
            Console.WriteLine("Has tentative activation focus = {0}",
                              activationFocusChangedEventArgs.Focus == ActivationFocus.HasTentativeActivationFocus);
            Console.WriteLine("Has no activation focus = {0}",
                              activationFocusChangedEventArgs.Focus == ActivationFocus.None);
        }
Пример #3
0
        /// <summary>
        /// Callback method called when an activation focus changed event has 
        /// been received from the EyeX Engine for the interactor associated 
        /// with this FrameworkElement.
        /// </summary>
        /// <param name="sender">The <see cref="FrameworkElement"/> that got the event.</param>
        /// <param name="e">The <see cref="ActivationFocusChangedEventArgs"/> for the event.</param>
        private static void OnActivationFocusChanged(object sender, ActivationFocusChangedEventArgs e)
        {
            var element = sender as FrameworkElement;
            if (null == element) { return; }

            element.SetActivationFocus(e.Focus);
            element.RaiseEvent(new RoutedEventArgs(ActivationFocusChangedEvent, element));
        }