Skip to content

Instantly share code, notes, and snippets.

@chribben
Created October 7, 2012 10:06
Show Gist options
  • Save chribben/3847741 to your computer and use it in GitHub Desktop.
Save chribben/3847741 to your computer and use it in GitHub Desktop.
Async gotcha in C# II
async void AcquireFromCamera(object sender, RoutedEventArgs e)
{
try
{
var imageStream = await _cameraCapture.Shoot();
var dto = new Dto(){ImageStream = imageStream};
_handler.ImageCaptured(dto);
Frame.Navigate(typeof(EditDataPage), dto.Id);
}
catch (Exception ex)
{
new MessageDialog(ex.Message).ShowAsync();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment