I've been trying to find how does the lifecycle of an application with a GUI written in XAML looks like. This blog post really confused me. The quote:
To fully understand the areas of opportunity for improving startup time, it's important to understand the workflow of a launching application.
1. The App constructor is called in App.xaml.cs.
2. XAML in App.xaml is parsed.
3. Application_Launching is called in App.xaml.cs.
4. The Page constructor of your MainPage is called.
5. XAML in your MainPage is parsed.
6. OnNavigatedTo is called in your MainPage.
I though that XAML is compiled to BAML and embedded to dll. Runtime just translates BAML to .Net objects.
Is it different for WP7 Silverlight? Does Runtime parse it like a browser parses HTML? What is the point of C# files generated from XAML? (e.g. Main.xaml.g.cs) Is it different for C++ and XAML apps?
.g.cs
files are auto-generated and contain information related to the general layout of a XAML page. Here is a pretty good description.
The runtime indeed parses the XAML that is embedded in the assembly - unlike WPF, it is not embedded as BAML.