private async Task UpdateHashtagImage() { var hashtag = HashtagParser.FindHashtags(queue.Name).FirstOrDefault(); if (hashtag != null) { // BitmapImage here gives an odd error - https://wpfanimatedgif.codeplex.com/discussions/439040 var image = BitmapFrame.Create(new Uri("https://softwire.ontoast.io/hashtags/image/" + hashtag, UriKind.Absolute)); ImageBehavior.SetAnimatedSource(HashtagImage, image); } }
private async Task UpdateHashtagImage() { var hashtag = HashtagParser.FindHashtags(QueueName.Text).FirstOrDefault(); var queueName = QueueName.Text; if (hashtag != null) { // Debounce to prevent loading while typing await Task.Delay(TimeSpan.FromSeconds(0.3)); if (QueueName.Text == queueName) { // BitmapImage here gives an odd error - https://wpfanimatedgif.codeplex.com/discussions/439040 var image = BitmapFrame.Create(new Uri("https://softwire.ontoast.io/hashtags/image/" + hashtag, UriKind.Absolute)); ImageBehavior.SetAnimatedSource(HashtagImage, image); } } }