What is .baml file?

2019-01-26 03:28发布

问题:

What is .baml file and what's the use of this file? Who creates this file?

回答1:

A compiled XAML file.

Wikipedia says:

A XAML file can be compiled into a .baml (Binary XAML) file, which may be inserted as a resource into a .NET Framework assembly. At run-time, the framework engine extracts the .baml file from assembly resources, parses it, and creates a corresponding WPF visual tree or workflow.



回答2:

.baml = Binary Application Markup File, a compiled XAML file.



回答3:

BAML form is an optimized form of XAML used by the WPF XAML implementation. It is optimized in the sense that it uses internal lookups and tokens for commonly used types or members. The optimization is useful as an implementation detail that addresses packaging size and load time for WPF application scenarios that involve XAML. Full Topic on Msdn



回答4:

The purpose of BAML is only for checking if generated WPF controls have right values in their properties. Compiled XAML has also its auto-generated *.cs code. You can look at in your app\DEBUG\OBJ directory. Every XAML file has generated cs. Its name is XAMLfileName.g.cs where g means generated.



标签: wpf xaml baml