In a WPF application, there is a sequence of methods that are called in the App class (in App.xaml.cs) and the AppBootstrapper class (in AppBoostrapper.cs). For the application I'm working on, I needed to know the order that these methods are called. Since I figure that someone else may want to know that too, I'm documenting it here.
Not all of these methods may exist in your application, since you may not have overridden the methods in the base classes.
- static App() constructor is called
- Instance App() constructor is called. The InitializedComponent() method of this then calls
- static AppBootstrapper() constructor
- Instance AppBootstrapper() constructor. The base() method invocation then calls
- AppBootstrapper StartRuntime() method. The base.StartRuntime() method invocation then calls
- AppBootstrapper SelectAssemblies() method
- AppBootstrapper PrepareApplication() method
- AppBootstrapper Configure() method
- AppBootstrapper StartRuntime() method. The base.StartRuntime() method invocation then calls
- App OnStartup() is called. The base.OnStartup() method invocation then calls
- AppBootstrapper OnStartup. The base.OnStartup() method invocation then calls
- AppBootstrapper GetInstance() method (possibly multiple times)
- AppBootstrapper GetAllInstances() method
- AppBootstrapper OnStartup. The base.OnStartup() method invocation then calls
- App OnExit() is called. The base.OnExit() method invocation then calls
- AppBootstrapper OnExit()
No comments :
Post a Comment
Note: Only a member of this blog may post a comment.