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