Skip to content

Commit

Permalink
Animations was not playing when initially loaded.
Browse files Browse the repository at this point in the history
Was not loading animation because isLoadingDeferred was false.
  • Loading branch information
MattyBoy authored Apr 25, 2018
1 parent cddbc48 commit e518035
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions WpfAnimatedGif/ImageBehavior.cs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,15 @@ private static void AnimatedSourceChanged(DependencyObject o, DependencyProperty
var oldValue = e.OldValue as ImageSource;
var newValue = e.NewValue as ImageSource;
if (ReferenceEquals(oldValue, newValue))
{
if (imageControl.IsLoaded)
{
var isAnimLoaded = GetIsAnimationLoaded(imageControl);
if (!isAnimLoaded)
InitAnimationOrImage(imageControl);
}
return;
}
if (oldValue != null)
{
imageControl.Loaded -= ImageControlLoaded;
Expand Down

0 comments on commit e518035

Please sign in to comment.