@@ -279,10 +279,8 @@ public void ReQuery()
279279
280280 public void ReQuery ( bool reselect )
281281 {
282- if ( SelectedIsFromQueryResults ( ) )
283- {
284- QueryResults ( isReQuery : true , reSelect : reselect ) ;
285- }
282+ BackToQueryResults ( ) ;
283+ QueryResults ( isReQuery : true , reSelect : reselect ) ;
286284 }
287285
288286 [ RelayCommand ]
@@ -491,7 +489,7 @@ private void Esc()
491489 }
492490 }
493491
494- public void BackToQueryResults ( )
492+ private void BackToQueryResults ( )
495493 {
496494 if ( ! SelectedIsFromQueryResults ( ) )
497495 {
@@ -610,6 +608,8 @@ public void ChangeQueryText(string queryText, bool isReQuery = false)
610608 {
611609 Application . Current . Dispatcher . Invoke ( ( ) =>
612610 {
611+ BackToQueryResults ( ) ;
612+
613613 if ( QueryText != queryText )
614614 {
615615 // re-query is done in QueryText's setter method
@@ -1266,8 +1266,6 @@ private Result ContextMenuTopMost(Result result)
12661266 {
12671267 _topMostRecord . Remove ( result ) ;
12681268 App . API . ShowMsg ( InternationalizationManager . Instance . GetTranslation ( "success" ) ) ;
1269- // if user happens to open context menu, we need to return back to query results before changing query
1270- App . API . BackToQueryResults ( ) ;
12711269 App . API . ReQuery ( ) ;
12721270 return false ;
12731271 }
@@ -1285,8 +1283,6 @@ private Result ContextMenuTopMost(Result result)
12851283 {
12861284 _topMostRecord . AddOrUpdate ( result ) ;
12871285 App . API . ShowMsg ( InternationalizationManager . Instance . GetTranslation ( "success" ) ) ;
1288- // if user happens to open context menu, we need to return back to query results before changing query
1289- App . API . BackToQueryResults ( ) ;
12901286 App . API . ReQuery ( ) ;
12911287 return false ;
12921288 }
0 commit comments