Skip to content

Commit bae1fb0

Browse files
author
msftbot[bot]
authored
Update ExecuteOnUIThreadAsync to EnqueueAsync (#3936)
## Fixes # This will fix the oversight in the documentation after the 7.0 breaking change ## PR Type Documentation content changes Sample app changes ## What is the current behavior? The sample app documentation use the old ExecuteOnUIThreadAsync methos ## What is the new behavior? The sample app documentation use the new EnqueueAsync method
2 parents 949bab9 + 63bfd70 commit bae1fb0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/DispatcherQueueHelper/DispatcherQueueHelperCode.bind

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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!";

0 commit comments

Comments
 (0)