Created
November 10, 2012 08:27
-
-
Save JakeGinnivan/4050418 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public async void SaveDocument() | |
| { | |
| if (IsWorking) return; | |
| var doc = MDI.ActiveItem as DocumentViewModel; | |
| if (doc != null) | |
| { | |
| using (DoingWork(string.Format("Saving {0}", doc.MarkpadDocument.Title))) | |
| { | |
| await doc.Save(); | |
| await TaskEx.Delay(5000); | |
| } | |
| } | |
| } | |
| //If I add this guy, I get a 5 second UI thread lockup... wtf | |
| public bool CanSaveDocument | |
| { | |
| get { return !IsWorking; } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Who sets IsWorking, because the moment that is set is when CM will be handling the event not when you hit the await.