コード例 #1
0
        private void InvokePointEvent(EventHandler <PointManipulationEventArgs> handler)
        {
            if (handler == null || _startArgs == null)
            {
                return;
            }
            UIElement manipulationContainer      = _startArgs.ManipulationContainer;
            PointManipulationEventArgs eventArgs = null;

            if (manipulationContainer != _host)
            {
                try
                {
                    Point origin =
                        manipulationContainer.TransformToVisual(_host).Transform(_startArgs.ManipulationOrigin);
                    eventArgs = new PointManipulationEventArgs(origin, _host);
                    handler(_host, eventArgs);
                }
                catch
                {
                }
            }
            else
            {
                eventArgs = new PointManipulationEventArgs(_startArgs.ManipulationOrigin, _host);
                handler(_host, eventArgs);
            }

            if (eventArgs != null)
            {
                _completed = eventArgs.Handled;
            }
        }
コード例 #2
0
        private void InvokePointEvent(EventHandler<PointManipulationEventArgs> handler)
        {
            if (handler == null || _startArgs == null)
                return;
            UIElement manipulationContainer = _startArgs.ManipulationContainer;
            PointManipulationEventArgs eventArgs = null;
            if (manipulationContainer != _host)
            {
                try
                {
                    Point origin =
                        manipulationContainer.TransformToVisual(_host).Transform(_startArgs.ManipulationOrigin);
                    eventArgs = new PointManipulationEventArgs(origin, _host);
                    handler(_host, eventArgs);
                }
                catch
                {
                }
            }
            else
            {
                eventArgs = new PointManipulationEventArgs(_startArgs.ManipulationOrigin, _host);
                handler(_host, eventArgs);
            }

            if (eventArgs != null)
                _completed = eventArgs.Handled;
        }
コード例 #3
0
ファイル: ReadPage.xaml.cs プロジェクト: karbazol/FBReaderCS
        private void PageOnHold(object sender, PointManipulationEventArgs e)
        {
            var point = e.ManipulationOrigin;


            var word = PageCanvas.CurrentTexts.FirstOrDefault(l => l.Rect.Contains(point));
            
            if (word == null)
                return;

            var words = PageCanvas.CurrentTexts.Where(w => w.TokenID == word.TokenID).ToList();

            word = words.FirstOrDefault();
            TextRenderData wordContinuation = words.LastOrDefault() ?? word;
            
            //TextRenderData word = PageCanvas.CurrentTexts.FirstOrDefault(l => l.Rect.Contains(point));
            
            InitTextSelection(word, wordContinuation);
        }
コード例 #4
0
ファイル: ReadPage.xaml.cs プロジェクト: karbazol/FBReaderCS
        private void OnTextTap(object sender, PointManipulationEventArgs e)
        {
            if (PageCanvas.CheckSelection(GetTapPoint(e.ManipulationOrigin)))
                return;

            ClearTextSelection();
        }
コード例 #5
0
ファイル: ReadPage.xaml.cs プロジェクト: karbazol/FBReaderCS
 private void PageOnTap(object sender, PointManipulationEventArgs e)
 {
     if (_link != null)
     {
         GotoLink(_link.LinkID);
         PageCanvas.Manipulator.Resume();
         _link = null;
     }
 }