This project is read-only.

The Application Bootstrapper


Any application needs to start up somehow. Application bootstrapping is the process of initializing the application and displaying the root view model.

Bootstrapping an Application

Bootstrapping an application in the DevForce Application Framework is accomplished by means of a bootstrapper class created as a static resource in the applications’s App.xaml. The bootstrapper class is created by extending the generic class FrameworkBootstrapper<TRootModel>.

The bootstrapper needs the type of the ViewModel that represents the first screen the user should see. The ViewModel must be decorated with the proper MEF export attribute in order for the bootstrapper to create an instance through MEF.

public class AppBootstrapper : FrameworkBootstrapper<MainViewModel>
    // Add additional logic if required. 

Then all that needs to be done is to create a static resource from the bootstrapper:

<Application x:Class="SampleApplication.App" 
        <app:AppBootstrapper x:Key="Bootstrapper" />

Last edited Dec 14, 2011 at 7:58 AM by marcelgood, version 6


No comments yet.