Example #1
0
        private void GazeElement_StateChanged(object sender, Microsoft.Toolkit.Uwp.Input.GazeInteraction.StateChangedEventArgs e)
        {
            Button btn = (sender as Button);

            float wd        = (float)(btn.ActualWidth / 2);
            float ht        = (float)(btn.ActualHeight / 2);
            float enterSize = 1.1f;

            if (e.PointerState == PointerState.Enter)
            {
                btn.Scale(enterSize, enterSize, wd, ht, 100, 0, EasingType.Default).Start();
            }


            if (e.PointerState == PointerState.Exit)
            {
                btn.Scale(1, 1, wd, ht, 500, 0, EasingType.Default).Start();
            }
        }
        // Primarily handles visual appearance when user looks at each button
        private void GazeElement_StateChanged(object sender, Microsoft.Toolkit.Uwp.Input.GazeInteraction.StateChangedEventArgs e)
        {
            Button btn = (sender as Button);

            if (btn == CurrentlyActivated && selectedScaleInMode)
            {
                return;
            }

            float radius    = (float)(btn.Width / 2);
            float enterSize = 1.1f;

            if (e.PointerState == PointerState.Enter)
            {
                btn.Scale(enterSize, enterSize, radius, radius, 100, 0, EasingType.Default).Start();
            }

            if (e.PointerState == PointerState.Exit)
            {
                btn.Scale(1, 1, radius, radius, 500, 0, EasingType.Default).Start();
            }
        }
 internal void RaiseStateChanged(object sender, StateChangedEventArgs args)
 {
     StateChanged?.Invoke(sender, args);
 }