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; } }
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; }
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); }
private void OnTextTap(object sender, PointManipulationEventArgs e) { if (PageCanvas.CheckSelection(GetTapPoint(e.ManipulationOrigin))) return; ClearTextSelection(); }
private void PageOnTap(object sender, PointManipulationEventArgs e) { if (_link != null) { GotoLink(_link.LinkID); PageCanvas.Manipulator.Resume(); _link = null; } }