public void CreateGifAnimation(MemoryStream memoryStream) { DeletePreviousImage(); gifAnimation = null; gifAnimation = new GifAnimation(); gifAnimation.CreateGifAnimation(memoryStream); gifAnimation.Stretch = Stretch; gifAnimation.StretchDirection = StretchDirection; this.AddChild(gifAnimation); }
private void GifImage_Unloaded(object sender, RoutedEventArgs e) { if (gifAnimation != null) { gifAnimation.Dispose(); } image = null; gifAnimation = null; }
private void DeletePreviousImage() { if (image != null) { this.RemoveLogicalChild(image); image = null; } if (gifAnimation != null) { this.RemoveLogicalChild(gifAnimation); gifAnimation = null; } this.Content = null; }