private static void OnInteractionChanged(DependencyObject ob, DependencyPropertyChangedEventArgs args)
        {
            var element     = ob as FrameworkElement;
            var interaction = (Interaction)args.NewValue;

            GazePointerProxy.SetInteraction(element, interaction);
        }
示例#2
0
        /// <summary>
        /// Method called when the GazeInput.Interaction attached property is set to a new value.
        /// </summary>
        /// <param name="element">The element being set. May be null to indicate whole user interface.</param>
        /// <param name="value">The interaction enablement value being set.</param>
        internal static void SetInteraction(FrameworkElement element, Interaction value)
        {
            // Get or create a GazePointerProxy for element.
            if (!(element.GetValue(_gazePointerProxyProperty) is GazePointerProxy proxy))
            {
                proxy = new GazePointerProxy(element);
                element.SetValue(_gazePointerProxyProperty, proxy);
            }

            // Set the proxy's _isEnabled value.
            proxy.SetIsEnabled(element, value == Interaction.Enabled);
        }
示例#3
0
 private static void OnInteractionChanged(DependencyObject ob, DependencyPropertyChangedEventArgs args) =>
 GazePointerProxy.SetInteraction((FrameworkElement)ob, (Interaction)args.NewValue);