title: C# - WPF - Set random picture to <Image>
body: <p>How can I set random picture to WPF <code>&lt;Image&gt;</code>? </p>
  
  <p>In my code I have 4 images.</p>
  
  <p>Function <code>img1_Loaded_1</code> sets sources of the images like this:</p>
  
  <p>The problem is that I would like 2 images to have the same picture. For example img1 and img4 would have the same picture and image2 would have different and img3 also would have different picture. At this moment I made it like this but I would like to set this picture to img1, img2 and so on dynamically. I would like also randomize which 2 of this 4 images would have the same picture.</p>
  
  <p>Any ideas how can I achieve this ?</p>