File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -423,14 +423,18 @@ protected override void OnMouseEnter(MouseEventArgs e)
423
423
{
424
424
//if the invisible popup that is watching the mouse, isn't where we expected it to be
425
425
//then the main popup toggle has been moved off screen...so we shouldn't show the popup content
426
- var popupScreenPoint = _popupContentControl . PointToScreen ( new Point ( ) ) ;
427
- popupScreenPoint . Offset ( - _popupContentControl . Margin . Left , - _popupContentControl . Margin . Top ) ;
428
- var expectedPopupScreenPoint = PointToScreen ( _popupPointFromLastRequest ) ;
429
-
430
- if ( Math . Abs ( popupScreenPoint . X - expectedPopupScreenPoint . X ) > ActualWidth / 3
431
- ||
432
- Math . Abs ( popupScreenPoint . Y - expectedPopupScreenPoint . Y ) > ActualHeight / 3 )
433
- return ;
426
+ var inputSource = PresentationSource . FromVisual ( _popupContentControl ) ;
427
+ if ( inputSource != null )
428
+ {
429
+ var popupScreenPoint = _popupContentControl . PointToScreen ( new Point ( ) ) ;
430
+ popupScreenPoint . Offset ( - _popupContentControl . Margin . Left , - _popupContentControl . Margin . Top ) ;
431
+ var expectedPopupScreenPoint = PointToScreen ( _popupPointFromLastRequest ) ;
432
+
433
+ if ( Math . Abs ( popupScreenPoint . X - expectedPopupScreenPoint . X ) > ActualWidth / 3
434
+ ||
435
+ Math . Abs ( popupScreenPoint . Y - expectedPopupScreenPoint . Y ) > ActualHeight / 3 )
436
+ return ;
437
+ }
434
438
}
435
439
436
440
SetCurrentValue ( IsPopupOpenProperty , true ) ;
You can’t perform that action at this time.
0 commit comments