/// <summary> /// Gets the entity image. /// </summary> private async Task GetImageAsync() { Image img = await ImageService.GetImageAsync(GetImageUrl()).ConfigureAwait(false); if (img != null) { m_image = img; ContactImageUpdated?.ThreadSafeInvoke(this, EventArgs.Empty); } }
/// <summary> /// Gets the entity image. /// </summary> /// <param name="useFallbackUri">if set to <c>true</c> [use fallback URI].</param> private async Task GetImageAsync(bool useFallbackUri = false) { while (true) { Image img = await ImageService.GetImageAsync(GetImageUrl(useFallbackUri)).ConfigureAwait(false); if (img == null) { if (useFallbackUri) { return; } useFallbackUri = true; continue; } m_image = img; // Notify the subscriber that we got the image ContactImageUpdated?.ThreadSafeInvoke(this, EventArgs.Empty); break; } }