title: Draw Ontop Of Image Control In WPF
body: <p>I am working on porting over an old WinForms project to WPF but have hit a brick wall. In this old WinForms project, I am using a picture control that is painting an image every second. Along with that, I have the controls 'Paint' event overridden to draw custom things on top of the image once it is already set.</p>
  
  <p>So for example my code flow is something like:</p>
  
  <pre class="lang-cs prettyprint-override"><code>private void timer1_Tick(object sender, System.EventArgs e)
  {
      pictureBox1.Load("some/image/path");
  }
  private void pictureBox1_Paint(object sender, PaintEventArgs e)
  {
      var g = e.Graphics;
      // do custom drawing on top of the picture here..
  }
  </code></pre>
  
  <p>WPF offers no direct 'Paint' event so I'm unsure how I should be properly porting this over to WPF and still keep an MVVM pattern. </p>
  
  <p>So my question(s) would be:</p>
  
  <ul>
  <li>Is using an Image control the proper method for this setup?  </li>
  <li>How should I go about recreating this similar setup in WPF where I can update the image as needed, then draw things on top of it.</li>
  </ul>
  
  <p><em>My intent is to keep with an traditional MVVM pattern but still be able to draw onto the image after it is loaded. All the drawing is done from inside the application, there is no user interaction to the drawing. I am basically drawing a map with points of interest on top of the map image in real time. The map is static and not broken into pieces like Google's tiles and such so I have no issues with just loading directly from disk.</em></p>