private async Task RefreshViewportAsync() { Stream imageStream = await _googleMapsApiService.GetViewportStreamAsync(_latitude, _longitude, DefaultWidth, DefaultHeight, _zoom); await App.Current.Dispatcher.BeginInvoke((Action) delegate() { var bitmapImage = new BitmapImage(); bitmapImage.BeginInit(); bitmapImage.StreamSource = imageStream; bitmapImage.EndInit(); ViewportImageSource = bitmapImage; }); }