public void ShowSelector() { int cursorPoint = textView.Caret.Position.BufferPosition; if (textView.Caret.ContainingTextViewLine.End.Position == cursorPoint) { //caret is at end of line back it up one cursorPoint = cursorPoint - 1; } SnapshotPoint point = new SnapshotPoint(textView.TextSnapshot, cursorPoint); SnapshotPoint point2 = new SnapshotPoint(textView.TextSnapshot, cursorPoint + 1); var span = new SnapshotSpan(point, point2); // Align the image with the top of the bounds of the text geometry Geometry g = textView.TextViewLines.GetMarkerGeometry(span); if (g != null) { AceJumperControl aceJumperControl = new AceJumperControl(this.textView); Canvas.SetLeft(aceJumperControl, g.Bounds.Left); Canvas.SetTop(aceJumperControl, g.Bounds.Top); this.aceLayer.AddAdornment(AdornmentPositioningBehavior.ViewportRelative, span, null, aceJumperControl, null); this.Active = true; } }
public void ShowSelector() { int cursorPoint = textView.Caret.Position.BufferPosition; if (textView.Caret.ContainingTextViewLine.End.Position == cursorPoint) { //caret is at end of line back it up one cursorPoint = cursorPoint - 1; } SnapshotPoint point = new SnapshotPoint(textView.TextSnapshot, cursorPoint); SnapshotPoint point2 = new SnapshotPoint(textView.TextSnapshot, cursorPoint+1); var span = new SnapshotSpan(point, point2); // Align the image with the top of the bounds of the text geometry Geometry g = textView.TextViewLines.GetMarkerGeometry(span); if (g != null) { AceJumperControl aceJumperControl = new AceJumperControl(this.textView); Canvas.SetLeft(aceJumperControl, g.Bounds.Left); Canvas.SetTop(aceJumperControl, g.Bounds.Top); this.aceLayer.AddAdornment(AdornmentPositioningBehavior.ViewportRelative, span, null, aceJumperControl, null); this.Active = true; } }