Skip to content

How does GravatarImageSource access ImageSource.CancellationTokenSource? #1097

Closed Answered by bijington
Ghostbird asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @Ghostbird,

Please see my answers to your questions below:

I still don't really get why it's done that way.

I agree it is quite tricky to read. The underlying concept is to debounce any changes coming in and these can come from each of the properties on this class (e.g. Email, DefaultImage) as well as the the sizing changing of the control hosting the image. By debouncing we try to reduce the number of requests to gravatar.com.

My questions are:

  • Should I do the same in my implementation?

I guess if it is likely that the stream could be requested multiple times in a very short space of time debouncing would be a good option.

  • How can the class access ImageSource.CancellationToken…

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@Ghostbird
Comment options

@bijington
Comment options

@Ghostbird
Comment options

Answer selected by Ghostbird
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants