File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Microsoft.Toolkit.Uwp.SampleApp/SamplePages/DispatcherQueueHelper Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ int crossThreadReturnedValue = await Task.Run<int>( async () =>
6
6
{
7
7
// Task.Run() will guarantee the given piece of code be executed on a separate thread pool.
8
8
// This is used to simulate the scenario of updating the UI element from a different thread.
9
- int returnedFromUIThread = await dispatcherQueue.ExecuteOnUIThreadAsync <int>(() =>
9
+ int returnedFromUIThread = await dispatcherQueue.EnqueueAsync <int>(() =>
10
10
{
11
11
NormalTextBlock.Text = "Updated from a random thread!";
12
12
return 1;
@@ -18,4 +18,4 @@ int crossThreadReturnedValue = await Task.Run<int>( async () =>
18
18
});
19
19
20
20
21
- NormalTextBlock.Text += $" And the value {crossThreadReturnedValue} was also returned successfully!";
21
+ NormalTextBlock.Text += $" And the value {crossThreadReturnedValue} was also returned successfully!";
You can’t perform that action at this time.
0 commit comments