Пример #1
0
        private void _rootGrid_PointerReleased(object sender, PointerRoutedEventArgs e)
        {
            var pointer = e.Pointer;

            if (pointer.PointerId == _pointerId)
            {
                var point = e.GetCurrentPoint(_rootGrid);
                UpdateEyedropper(point.Position);
                PickEnded?.Invoke(this, EventArgs.Empty);
                _pointerId = 0;
                _taskSource.SetResult(Color);
            }
        }
Пример #2
0
        private async void TargetGrid_PointerReleased(object sender, PointerRoutedEventArgs e)
        {
            var pointer = e.Pointer;

            if (pointer.PointerId == _pointerId)
            {
                var point = e.GetCurrentPoint(_rootGrid);
                if (_appScreenshot == null)
                {
                    await UpdateAppScreenshotAsync();
                }
                UpdateEyedropper(point.Position);
                PickEnded?.Invoke(this, EventArgs.Empty);
                _pointerId = 0;
                if (!_taskSource.Task.IsCanceled)
                {
                    _taskSource.SetResult(Color);
                }
            }
        }
Пример #3
0
 private void Eyedropper_PickEnded(Eyedropper sender, EventArgs args)
 {
     EyedropperEnabled = false;
     PickEnded?.Invoke(this, args);
 }