What does a XAML app workflow look like

Go To StackoverFlow.com

3

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?

2012-04-05 20:34
by Lukasz Madon


2

.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.

2012-04-06 02:44
by Den Delimarsky
This design is really surprising. SL for WP7 works in a very limited environment and it seems to be the first candidate for XAML compilation - Lukasz Madon 2012-04-06 17:47
Ads