Example #1
0
 private void InitTextSelection(TextRenderData word, TextRenderData wordContinuation)
 {
     AppBar.Close();
     PageCanvas.Manipulator.Pause();
     PageCanvas.SetSelection(word, wordContinuation);
     ManipulationService.SetManipulationListener(PageCanvas, _textManipulationListener);
     TouchPanel.EnabledGestures = GestureType.FreeDrag;
     AppBar.Visibility          = Visibility.Collapsed;
     PageCanvas.ShowActionButtons();
 }
Example #2
0
        private void OnTextManipulatonDelta(object sender, ManipulationDeltaEventArgs e)
        {
            Vector2 vector2 = new Vector2();

            while (TouchPanel.IsGestureAvailable)
            {
                vector2 = TouchPanel.ReadGesture().Position;
            }
            if (Orientation == PageOrientation.LandscapeLeft)
            {
                vector2 = new Vector2(vector2.Y, 480f - vector2.X);
            }
            else if (Orientation == PageOrientation.LandscapeRight)
            {
                vector2 = new Vector2((float)ActualWidth - vector2.Y, vector2.X);
            }
            if (!this._textManipulationStarted)
            {
                return;
            }
            var            point = new Point(vector2.X - _offsetX, vector2.Y - _offsetY);
            TextRenderData a     = PageCanvas.CurrentTexts.FirstOrDefault(l => l.Rect.Contains(point));

            if (a == null)
            {
                return;
            }

            if (a.TokenID < _lastWord.TokenID)
            {
                a = PageCanvas.CurrentTexts.FirstOrDefault(l => l.TokenID == a.TokenID);
            }
            else
            {
                a = PageCanvas.CurrentTexts.LastOrDefault(l => l.TokenID == a.TokenID);
            }


            PageCanvas.SetSelection(a, _lastWord);

            Debug.WriteLine(_lastWord.Text);
        }