title: SlimDX viewports in WPF controls
body: <p>I am transitioning from WinForms/XNA to WPF/SlimDX because:</p>
  
  <ul>
  <li>a) all of the benefits of WPF over
  WinForms (but learning curve = ouch!)</li>
  <li>b) I would like to have multiple
  SlimDX viewports attached to Panels.
  XNA has 1 "game" screen.    </li>
  <li>c, last and least) DirectX 10 support</li>
  </ul>
  
  <p>All of my previous XNA code is in C#. I am having trouble figuring out how to port this over to SlimDX and WPF on a high level. I have searched like crazy. The closest I have found are:</p>
  
  <p>1) <a href="http://www.gamedev.net/community/forums/topic.asp?topic_id=507941" rel="noreferrer">http://www.gamedev.net/community/forums/topic.asp?topic_id=507941</a>
  Many articles point to this discussion, however it is incomplete and I can't figure out the XAML, and I get device errors after attaching all of the _slimDXDevice and Window1 events that were left out.</p>
  
  <p>2) <a href="http://www.codeproject.com/KB/WPF/D3DImage.aspx" rel="noreferrer">http://www.codeproject.com/KB/WPF/D3DImage.aspx</a>
  This article assumes the user is porting C++. I am porting XNA code which is very close to MDX code.</p>
  
  <p>If I could get to the point where I have a WPF form with a custom SlimDX driven viewport that was just a blue box, I could go from there. In XNA I rendered many separate RenderTargets and placed them all over the screen, now I want to attach them to controls. But first, just 1 blue box! :D</p>
  
  <p>Any ideas? I feel that this is either simple or that there's some "cookie cutter" code that I'm missing. Greatly appreciated!</p>