Example #1
0
        private async void InkCanvas_PointerPressed(object sender, PointerRoutedEventArgs e)
        {
            var position = e.GetCurrentPoint(_inkCanvas).Position;

            while (_analyzer.IsAnalyzing)
            {
                await Task.Delay(TimeSpan.FromMilliseconds(BusyWaitingTime));
            }

            if (_selectionRectangleService.ContainsPosition(position))
            {
                // Pressed on the selected rect, do nothing
                return;
            }

            selectedNode = _analyzer.FindHitNode(position);
            ShowOrHideSelection(selectedNode);
        }
Example #2
0
        private void UnprocessedInput_PointerPressed(InkUnprocessedInput sender, PointerEventArgs args)
        {
            var position = args.CurrentPoint.Position;

            if (_selectionRectangleService.ContainsPosition(position))
            {
                // Pressed on the selected rect, do nothing
                return;
            }

            lasso = new Polyline()
            {
                Stroke          = new SolidColorBrush(Colors.Blue),
                StrokeThickness = 1,
                StrokeDashArray = new DoubleCollection()
                {
                    5, 2
                },
            };

            lasso.Points.Add(args.CurrentPoint.RawPosition);
            _selectionCanvas.Children.Add(lasso);
            enableLasso = true;
        }