Skip to content

Commit

Permalink
Merge pull request #43 from MattyBoy4444/patch-1
Browse files Browse the repository at this point in the history
Animations was not playing when initially loaded.
  • Loading branch information
thomaslevesque authored Apr 26, 2018
2 parents cddbc48 + e518035 commit e4f460e
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 e4f460e

Please sign in to comment.