Image drag and drop (WPF Window)
<p>I need to drag and drop from <code>Image</code> <code>img2</code> to <code>Image</code> <code>img1</code>. That means that I want to copy <code>img2</code> when I drag it on <code>img1</code>. Program is starting, but destination <code>Image</code> <code>img1</code> is not changing after I drag <code>Image</code> <code>img2</code> on it. </p>

<blockquote>
  <p>How to solve this problem to make it work ?</p>
</blockquote>

<p><strong>My code below:</strong></p>

<p><em>XAML:</em></p>

<pre><code>&lt;Canvas Name="va"&gt;
        &lt;Image Name="img1" Height="100" Width="100" AllowDrop="True" Drop="img1_Drop" /&gt;
        &lt;Image Name="img2" Height="100" Width="100" Source="Resources/eye.bmp" 
               MouseLeftButtonDown="img2_MouseLeftButtonDown" AllowDrop="True" /&gt;
&lt;/Canvas&gt;
</code></pre>

<p><em>C# code:</em></p>

<pre><code>private void img2_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
    Image image = e.Source as Image;
    DataObject data = new DataObject(typeof(ImageSource), image.Source);
    DragDrop.DoDragDrop(image, data, DragDropEffects.All);
}

private void img1_Drop(object sender, DragEventArgs e)
{
    Image imageControl = (Image)sender;
    if ((e.Data.GetData(typeof(ImageSource)) != null))
    {
        ImageSource image = e.Data.GetData(typeof(ImageSource)) as ImageSource;
        imageControl = new Image() { Width = 100, Height = 100, Source = image };
        img1 = imageControl;
    }
}
</code></pre>