I know just one open-source code that does is, but a very good one, amazingly good: Inkscape:
http://en.wikipedia.org/wiki/Inkscape[
^],
http://inkscape.org/download/?lang=en[
^] (this page shows where to download source code).
When SVG to XAML export was first introduces, it wasn't really functional, but in recent version it works extremely well. I often advise it for WPF development which I did, and it worked very well. So, you can find this operation in source code and see how it works.
If you need to implement it in your .NET code, it will be considerable amount of work. First, you can just translate the code to C#. Another option is to use P/Invoke.
If you need to learn P/Invoke, start from here:
http://en.wikipedia.org/wiki/P/Invoke[
^],
http://msdn.microsoft.com/en-us/library/Aa712982[
^].
This CodeProject can also be useful:
Essential P/Invoke[
^].
One alternative to P/Invoke is to use C++/CLI mixed-mode (managed+unmanaged) project. This project could build a DLL required by the global hooks, but it can contain some managed wrapper CLI code, so, from the standpoint of your .NET application, you can use it as a regular .NET assembly, that is, reference it. Please see:
http://en.wikipedia.org/wiki/C%2B%2B/CLI[
^],
http://www.ecma-international.org/publications/standards/Ecma-372.htm[
^],
http://msdn.microsoft.com/en-us/library/xey702bw.aspx[
^],
http://msdn.microsoft.com/en-us/library/3bstk3k5[
^].
—SA