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