1
1
using System ;
2
2
using System . IO ;
3
+ using System . Threading . Tasks ;
3
4
using System . Windows ;
4
5
using System . Windows . Input ;
5
6
using Flow . Launcher . Infrastructure ;
@@ -67,7 +68,7 @@ public static MessageBoxResult Show(string messageBoxText, string caption, Messa
67
68
msgBox . Title = caption ;
68
69
msgBox . TitleTextBlock . Text = caption ;
69
70
msgBox . DescTextBlock . Text = messageBoxText ;
70
- SetImageOfMessageBox ( icon ) ;
71
+ _ = SetImageOfMessageBoxAsync ( icon ) ;
71
72
}
72
73
SetButtonVisibilityFocusAndResult ( button , defaultResult ) ;
73
74
msgBox . ShowDialog ( ) ;
@@ -143,24 +144,24 @@ private static void SetButtonVisibilityFocusAndResult(MessageBoxButton button, M
143
144
}
144
145
}
145
146
146
- private static async void SetImageOfMessageBox ( MessageBoxImage icon )
147
+ private static async Task SetImageOfMessageBoxAsync ( MessageBoxImage icon )
147
148
{
148
149
switch ( icon )
149
150
{
150
151
case MessageBoxImage . Exclamation :
151
- msgBox . SetImage ( "Exclamation.png" ) ;
152
+ await msgBox . SetImageAsync ( "Exclamation.png" ) ;
152
153
msgBox . Img . Visibility = Visibility . Visible ;
153
154
break ;
154
155
case MessageBoxImage . Question :
155
- msgBox . SetImage ( "Question.png" ) ;
156
+ await msgBox . SetImageAsync ( "Question.png" ) ;
156
157
msgBox . Img . Visibility = Visibility . Visible ;
157
158
break ;
158
159
case MessageBoxImage . Information :
159
- msgBox . SetImage ( "Information.png" ) ;
160
+ await msgBox . SetImageAsync ( "Information.png" ) ;
160
161
msgBox . Img . Visibility = Visibility . Visible ;
161
162
break ;
162
163
case MessageBoxImage . Error :
163
- msgBox . SetImage ( "Error.png" ) ;
164
+ await msgBox . SetImageAsync ( "Error.png" ) ;
164
165
msgBox . Img . Visibility = Visibility . Visible ;
165
166
break ;
166
167
default :
@@ -169,7 +170,7 @@ private static async void SetImageOfMessageBox(MessageBoxImage icon)
169
170
}
170
171
}
171
172
172
- private async void SetImage ( string imageName )
173
+ private async Task SetImageAsync ( string imageName )
173
174
{
174
175
var imagePath = Path . Combine ( Constant . ProgramDirectory , "Images" , imageName ) ;
175
176
var imageSource = await ImageLoader . LoadAsync ( imagePath ) ;
0 commit comments