Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

creating a Task instance doesn't execute it #1997

Merged
merged 1 commit into from
Jun 21, 2015

Conversation

thoemmi
Copy link
Collaborator

@thoemmi thoemmi commented Jun 21, 2015

Because of .NET 4.0 compatibility, MahApps.Metro can't use Task.FromResult. However, just returning new System.Threading.Tasks.Task(() => { }) doesn't help, because it won't execute the task. Instead, you should use a TaskCompletionSource. Since both methods in question already ise a TCS, in the PR I moved their creations to an earlier point and re-used them.

I noticed this issue when I tried to open two dialog at once, a continuation for the returned tasks never run.

punker76 added a commit that referenced this pull request Jun 21, 2015
creating a Task instance doesn't execute it
@punker76 punker76 merged commit 2c1fb55 into MahApps:master Jun 21, 2015
@punker76
Copy link
Member

thx @thoemmi that makes sense

@thoemmi thoemmi deleted the bad-FromResult-substitute branch June 21, 2015 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants