@@ -8,15 +8,15 @@ namespace Flow.Launcher
88{
99 public partial class ProgressBoxEx : Window
1010 {
11- private readonly Action _forceClosed ;
11+ private readonly Action _cancelProgress ;
1212
13- private ProgressBoxEx ( Action forceClosed )
13+ private ProgressBoxEx ( Action cancelProgress )
1414 {
15- _forceClosed = forceClosed ;
15+ _cancelProgress = cancelProgress ;
1616 InitializeComponent ( ) ;
1717 }
1818
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 )
2020 {
2121 ProgressBoxEx prgBox = null ;
2222 try
@@ -25,7 +25,7 @@ public static async Task ShowAsync(string caption, Func<Action<double>, Task> re
2525 {
2626 await Application . Current . Dispatcher . InvokeAsync ( ( ) =>
2727 {
28- prgBox = new ProgressBoxEx ( forceClosed )
28+ prgBox = new ProgressBoxEx ( cancelProgress )
2929 {
3030 Title = caption
3131 } ;
@@ -35,7 +35,7 @@ await Application.Current.Dispatcher.InvokeAsync(() =>
3535 }
3636 else
3737 {
38- prgBox = new ProgressBoxEx ( forceClosed )
38+ prgBox = new ProgressBoxEx ( cancelProgress )
3939 {
4040 Title = caption
4141 } ;
@@ -95,20 +95,25 @@ private void KeyEsc_OnPress(object sender, ExecutedRoutedEventArgs e)
9595 ForceClose ( ) ;
9696 }
9797
98- private void Button_Click ( object sender , RoutedEventArgs e )
98+ private void Button_Cancel ( object sender , RoutedEventArgs e )
9999 {
100100 ForceClose ( ) ;
101101 }
102102
103- private void Button_Cancel ( object sender , RoutedEventArgs e )
103+ private void Button_Minimize ( object sender , RoutedEventArgs e )
104104 {
105- ForceClose ( ) ;
105+ WindowState = WindowState . Minimized ;
106+ }
107+
108+ private void Button_Background ( object sender , RoutedEventArgs e )
109+ {
110+ Hide ( ) ;
106111 }
107112
108113 private void ForceClose ( )
109114 {
110115 Close ( ) ;
111- _forceClosed ? . Invoke ( ) ;
116+ _cancelProgress ? . Invoke ( ) ;
112117 }
113118 }
114119}
0 commit comments