Skip to content

Commit d6c0b93

Browse files
committed
Fix System.InvalidOperationException: This Visual is not connected to a PresentationSource on CompletionWindowBase.UpdatePosition
1 parent 87f22a5 commit d6c0b93

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

ICSharpCode.AvalonEdit/CodeCompletion/CompletionWindowBase.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,9 @@ protected void SetPosition(TextViewPosition position)
332332
protected void UpdatePosition()
333333
{
334334
TextView textView = this.TextArea.TextView;
335+
if (PresentationSource.FromVisual(textView) == null)
336+
return;
337+
335338
// PointToScreen returns device dependent units (physical pixels)
336339
Point location = textView.PointToScreen(visualLocation - textView.ScrollOffset);
337340
Point locationTop = textView.PointToScreen(visualLocationTop - textView.ScrollOffset);

0 commit comments

Comments
 (0)