示例#1
0
 private void OnProgressFeedback(object sender, DwellProgressEventArgs e)
 {
     DwellProgressBar.Maximum = 1.0;
     DwellProgressBar.Value   = e.Progress;
     if (e.State == DwellProgressState.Complete)
     {
         DwellProgressBar.Value = 0;
     }
 }
 private void OnInvokeProgress(object sender, DwellProgressEventArgs e)
 {
     if (e.State == DwellProgressState.Progressing)
     {
         ProgressShow.Value = 100.0 * e.Progress;
     }
     ProgressShow.IsIndeterminate = e.State == DwellProgressState.Complete;
     e.Handled = true;
 }
示例#3
0
        private void DwellProgress(object sender, DwellProgressEventArgs e)
        {
            var target = sender as FrameworkElement;

            if (target == null)
            {
                return;
            }

            // Find out where to render the dwell indicator
            var targetPosition = target.TransformToVisual(_gazeMarker).TransformPoint(new Point(0, 0));
            var targetWidth    = target.ActualWidth;
            var targetHeight   = target.ActualHeight;

            // Set the size
            var maxRadius = Math.Min(targetWidth, targetHeight);
            var radius    = Math.Min(maxRadius / 1.61803398875, 100);

            _dwell.Width        = radius;
            _dwell.Height       = radius;
            _dwellPosition.X    = targetPosition.X + (targetWidth - _dwell.Width) / 2;
            _dwellPosition.Y    = targetPosition.Y + (targetHeight - _dwell.Height) / 2;
            _dwellScale.CenterX = _dwell.Width / 2;
            _dwellScale.CenterY = _dwell.Height / 2;
            _dwellScale.ScaleX  = 1.0f - e.Progress;
            _dwellScale.ScaleY  = 1.0f - e.Progress;

            // Set the color and visibility of the indicator
            switch (e.State)
            {
            case DwellProgressState.Fixating:
                _dwell.Visibility = Visibility.Visible;
                _dwell.Fill       = GazeInput.DwellFeedbackEnterBrush;
                break;

            case DwellProgressState.Progressing:
                _dwell.Visibility = Visibility.Visible;
                _dwell.Fill       = GazeInput.DwellFeedbackProgressBrush;
                break;

            case DwellProgressState.Complete:
                _dwell.Visibility = Visibility.Visible;
                _dwell.Fill       = GazeInput.DwellFeedbackCompleteBrush;
                break;

            case DwellProgressState.Idle:
                _dwell.Visibility = Visibility.Collapsed;
                break;
            }

            // And tell the interaction library that you handled the event
            e.Handled = true;
        }
 private void OnInvokeProgress(object sender, DwellProgressEventArgs e)
 {
     e.Handled = true;
 }
示例#5
0
 private void OnInvokeProgress(object sender, DwellProgressEventArgs e)      // This comes from the original sln
 {
     // This is needed for dwelling xaml elements on the front end
     e.Handled = true;
 }
示例#6
0
 private void RemoveDwellProgressFeedback(object sender, DwellProgressEventArgs e)
 {
     e.Handled = true;
 }
示例#7
0
 private void OnLooking(object sender, DwellProgressEventArgs e)
 {
     e.Handled = true;
 }
示例#8
0
 // --------------- Helpers ---------------
 private void GazeElement_DwellProgressFeedback(object sender, DwellProgressEventArgs e)
 {
     e.Handled = true;
 }
示例#9
0
 public static void RemoveDwellProgressFeedback(object sender, DwellProgressEventArgs e)
 {
     e.Handled = true;
 }