开发者

Can Visual Studio generate C# code instead of XAML?

开发者 https://www.devze.com 2023-03-23 06:38 出处:网络
I love XAML and everything, but how can I make开发者_JAVA技巧 Visual Studio generate C# code instead?

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消