End Google Ads 201810 - BS.net 01 --> Source Code:
WPF GIF Animation

Current situation:
The animation is run in a list but I want that the animation run without a list.

My current code:
using System;
using System.Windows;
using System.Drawing;
using System.Diagnostics;
using WpfAnimatedControl;
using System.Windows.Documents;
using System.Collections.Generic;

namespace AnimatedControlTester
{
///
/// Interaction logic for Window1.xaml
/// public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
rich.Document = new System.Windows.Documents.FlowDocument();

Paragraph p = new Paragraph();
AnimatedImage aimg = new AnimatedImage();
aimg.Stretch = System.Windows.Media.Stretch.None;
System.Drawing.Image img;
img = AnimatedControlTester.Resources.Hexe;
aimg.LoadSmile((System.Drawing.Bitmap)img);
p.Inlines.Add(aimg);
rich.Document.Blocks.Add(p);

image1.Source = p;
}

private void aimg_AnimatedBitmapChanged(object sender, RoutedPropertyChangedEventArgs e)
{
Debug.WriteLine("AnimatedBitmapChanged event occured, add extra code here if necessary.");
}

}
}

Error on line:
image1.Source = p;

Error:
Cannot implicitly convert type 'System.Windows.Documents.Paragraph' to 'System.Windows.Media.ImageSource'