@@ -8,15 +8,15 @@ namespace Flow.Launcher
8
8
{
9
9
public partial class ProgressBoxEx : Window
10
10
{
11
- private readonly Action _forceClosed ;
11
+ private readonly Action _cancelProgress ;
12
12
13
- private ProgressBoxEx ( Action forceClosed )
13
+ private ProgressBoxEx ( Action cancelProgress )
14
14
{
15
- _forceClosed = forceClosed ;
15
+ _cancelProgress = cancelProgress ;
16
16
InitializeComponent ( ) ;
17
17
}
18
18
19
- public static async Task ShowAsync ( string caption , Func < Action < double > , Task > reportProgressAsync , Action forceClosed = null )
19
+ public static async Task ShowAsync ( string caption , Func < Action < double > , Task > reportProgressAsync , Action cancelProgress = null )
20
20
{
21
21
ProgressBoxEx prgBox = null ;
22
22
try
@@ -25,7 +25,7 @@ public static async Task ShowAsync(string caption, Func<Action<double>, Task> re
25
25
{
26
26
await Application . Current . Dispatcher . InvokeAsync ( ( ) =>
27
27
{
28
- prgBox = new ProgressBoxEx ( forceClosed )
28
+ prgBox = new ProgressBoxEx ( cancelProgress )
29
29
{
30
30
Title = caption
31
31
} ;
@@ -35,7 +35,7 @@ await Application.Current.Dispatcher.InvokeAsync(() =>
35
35
}
36
36
else
37
37
{
38
- prgBox = new ProgressBoxEx ( forceClosed )
38
+ prgBox = new ProgressBoxEx ( cancelProgress )
39
39
{
40
40
Title = caption
41
41
} ;
@@ -95,20 +95,25 @@ private void KeyEsc_OnPress(object sender, ExecutedRoutedEventArgs e)
95
95
ForceClose ( ) ;
96
96
}
97
97
98
- private void Button_Click ( object sender , RoutedEventArgs e )
98
+ private void Button_Cancel ( object sender , RoutedEventArgs e )
99
99
{
100
100
ForceClose ( ) ;
101
101
}
102
102
103
- private void Button_Cancel ( object sender , RoutedEventArgs e )
103
+ private void Button_Minimize ( object sender , RoutedEventArgs e )
104
104
{
105
- ForceClose ( ) ;
105
+ WindowState = WindowState . Minimized ;
106
+ }
107
+
108
+ private void Button_Background ( object sender , RoutedEventArgs e )
109
+ {
110
+ Hide ( ) ;
106
111
}
107
112
108
113
private void ForceClose ( )
109
114
{
110
115
Close ( ) ;
111
- _forceClosed ? . Invoke ( ) ;
116
+ _cancelProgress ? . Invoke ( ) ;
112
117
}
113
118
}
114
119
}
0 commit comments