File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,16 @@ public static T Open<T>(params object[] args) where T : Window
11
11
var window = Application . Current . Windows . OfType < Window > ( ) . FirstOrDefault ( x => x . GetType ( ) == typeof ( T ) )
12
12
?? ( T ) Activator . CreateInstance ( typeof ( T ) , args ) ;
13
13
Application . Current . MainWindow . Hide ( ) ;
14
+
15
+ // Fix UI bug
16
+ // Add `window.WindowState = WindowState.Normal`
17
+ // If only use `window.Show()`, Settings-window doesn't show when minimized in taskbar
18
+ // Not sure why this works tho
19
+ // Probably because, when `.Show()` fails, `window.WindowState == Minimized` (not `Normal`)
20
+ // https://stackoverflow.com/a/59719760/4230390
21
+ window . WindowState = WindowState . Normal ;
14
22
window . Show ( ) ;
23
+
15
24
window . Focus ( ) ;
16
25
17
26
return ( T ) window ;
You can’t perform that action at this time.
0 commit comments