Can Visual Studio generate C# code instead of XAML?
I love XAML and everything, but how can I make开发者_JAVA技巧 Visual Studio generate C# code instead?
This is for learning purposes, just to see how the compiler translates from XAML to C#.
Thank you!
I have written this tool which generates equivalent c# code for the xaml provided.
http://xamlgenerator.codeplex.com/
The compiler will create partial classes for your XAML to give you access to your identifiers in the code behind (look in /obj/Debug/*.g.cs, etc), but most of it is converted to a binary resource representation (BAML) which is then loaded at run time, not converted to MSIL.
Such a feature does not exist, and although you could write a plugin to achieve this behavior, such a plugin does not (yet) exist either. MSDN does a pretty good job of showing both XAML and C# representations of features.
精彩评论