Silverlight Controls in .NET Windows Form

2012-03-23 by

So I was experimenting today with the Expression Blend 3 UI and I say quite a few new controls that I felt were perfect to replace some older code that had, how shall we say, quirks.  So I did some looking and it is possible to create a WPF user control DLL and then add that control to an old style windows form.  This was a revelation to me, allowing me to slowly upgrade some of my applications from the .NET 2.0 space to the WPF Super GUI as I call it.

Here is what I did:

  1. Create a new WPF User Control Application
  2. Create your control, for instance I used the new charting controls to create a custom graph that accessed a SQL server
  3. Build the DLL
  4. Add a new Windows Form project to your solution
  5. Add a reference to the WPF user control Project
  6. You should now see in your toolbox the option for any control in that project
  7. Simply Drag and drop like any control into your .NET windows Form and Viola, you are done