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 () =>
66 {
77 // Task.Run() will guarantee the given piece of code be executed on a separate thread pool.
88 // 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>(() =>
1010 {
1111 NormalTextBlock.Text = "Updated from a random thread!";
1212 return 1;
@@ -18,4 +18,4 @@ int crossThreadReturnedValue = await Task.Run<int>( async () =>
1818 });
1919
2020
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