@@ -66,7 +66,8 @@ public MainViewModel(Settings settings)
66
66
Settings = settings ;
67
67
Settings . PropertyChanged += ( _ , args ) =>
68
68
{
69
- switch ( args . PropertyName ) {
69
+ switch ( args . PropertyName )
70
+ {
70
71
case nameof ( Settings . WindowSize ) :
71
72
OnPropertyChanged ( nameof ( MainWindowWidth ) ) ;
72
73
break ;
@@ -366,6 +367,7 @@ public string QueryText
366
367
set
367
368
{
368
369
_queryText = value ;
370
+ OnPropertyChanged ( ) ;
369
371
Query ( ) ;
370
372
}
371
373
}
@@ -429,11 +431,14 @@ public void ChangeQueryText(string queryText, bool reQuery = false)
429
431
{
430
432
if ( QueryText != queryText )
431
433
{
432
- // re-query is done in QueryText's setter method
433
- QueryText = queryText ;
434
- // set to false so the subsequent set true triggers
435
- // PropertyChanged and MoveQueryTextToEnd is called
436
- QueryTextCursorMovedToEnd = false ;
434
+ Application . Current . Dispatcher . Invoke ( ( ) =>
435
+ {
436
+ // re-query is done in QueryText's setter method
437
+ QueryText = queryText ;
438
+ // set to false so the subsequent set true triggers
439
+ // PropertyChanged and MoveQueryTextToEnd is called
440
+ QueryTextCursorMovedToEnd = false ;
441
+ } ) ;
437
442
}
438
443
else if ( reQuery )
439
444
{
@@ -752,7 +757,7 @@ private Query ConstructQuery(string queryText, IEnumerable<CustomShortcutModel>
752
757
753
758
queryBuilder . Replace ( '@' + shortcut . Key , shortcut . Expand ( ) ) ;
754
759
}
755
-
760
+
756
761
Application . Current . Dispatcher . Invoke ( ( ) =>
757
762
{
758
763
foreach ( var shortcut in builtInShortcuts )
@@ -887,9 +892,9 @@ public void Show()
887
892
{
888
893
MainWindowVisibility = Visibility . Visible ;
889
894
890
- MainWindowVisibilityStatus = true ;
891
-
892
895
MainWindowOpacity = 1 ;
896
+
897
+ MainWindowVisibilityStatus = true ;
893
898
} ) ;
894
899
}
895
900
0 commit comments