File tree Expand file tree Collapse file tree 1 file changed +20
-6
lines changed Expand file tree Collapse file tree 1 file changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -141,10 +141,17 @@ private static Task QueueForExcutionWhenUiThreadCreated(Action action)
141
141
{
142
142
Initialized -= handler ;
143
143
144
- //TODO: Should this call UiThreadTaskFactory.StartNew?
145
- action ( ) ;
144
+ try
145
+ {
146
+ //TODO: Should this call UiThreadTaskFactory.StartNew?
147
+ action ( ) ;
146
148
147
- tcs . SetResult ( true ) ;
149
+ tcs . TrySetResult ( true ) ;
150
+ }
151
+ catch ( Exception ex )
152
+ {
153
+ tcs . TrySetException ( ex ) ;
154
+ }
148
155
} ;
149
156
150
157
Initialized += handler ;
@@ -167,10 +174,17 @@ private static Task<T> QueueForExcutionWhenUiThreadCreated<T>(Func<T> func)
167
174
{
168
175
Initialized -= handler ;
169
176
170
- //TODO: Should this call UiThreadTaskFactory.StartNew?
171
- var result = func ( ) ;
177
+ try
178
+ {
179
+ //TODO: Should this call UiThreadTaskFactory.StartNew?
180
+ var result = func ( ) ;
172
181
173
- tcs . SetResult ( result ) ;
182
+ tcs . TrySetResult ( result ) ;
183
+ }
184
+ catch ( Exception ex )
185
+ {
186
+ tcs . TrySetException ( ex ) ;
187
+ }
174
188
} ;
175
189
176
190
Initialized += handler ;
You can’t perform that action at this time.
0 commit comments