Exemple #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(BUSY_WAITING_TIME));
            }

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

            selectedNode = analyzer.FindHitNode(position);
            ShowOrHideSelection(selectedNode);
        }
Exemple #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;
        }