Generated Source Code
Some procedural code does get generated in the XAML compilation process (if you use x:Class), but it’s just some “glue code” similar to what had to be written to load and parse a loose XAML file at runtime. Such files are given a suffix such as .g.cs and .g.i.cs (or .g.vb and .g.i.vb), where the g stands for generated and the i stands for IntelliSense.
Each generated source file contains a partial class definition for the class specified with x:Class on the root object element. This partial class contains a field (private by default but configurable with x:FieldModifier) for every named element in the XAML file, using the element name as the field name. It also contains an InitializeComponent method that does the grunt work ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access