Last active
August 29, 2015 14:05
-
-
Save Vanlalhriata/68a35d8c35301fd0a45d to your computer and use it in GitHub Desktop.
Using async methods synchronously
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
var getFileOperation = Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync(relativePath); | |
getFileOperation.AsTask().Wait(); | |
var file = getFileOperation.GetResults(); | |
var openReadOperation = file.OpenReadAsync(); | |
openReadOperation.AsTask().Wait(); | |
using (var stream = openReadOperation.GetResults().AsStreamForRead()) | |
{ | |
return Load(stream, segmentsX, segmentsY, width); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment