Composite application Guidance for WPF (3)

Source: Internet
Author: User

Create the first composite WPF application

1. Prerequisite Conditions:

You need to download to CAL (Composite application Library) libraries, which are actually several DLL files that will be referenced in the project to build our program, which you can download from here. Of course, you also need an IDE that can build WPF applications, such as VS2008.

2. Create Shell Project

2.1. Create a new WPF application in VS, add the Cal library file to the project reference

2.2. Rename the auto-generated Window1 main window and its corresponding file to the shell, which will serve as the shell for our composite app.

2.3. Creating bootstrapper, customizing how the program is initialized

Create a new Bootstrapper class to inherit from Unity Bootstrapper, and rewrite some of these methods to implement our custom

Internal class Bootstrapper:unitybootstrapper
{
protected override DependencyObject Createshell ()
{
var shell = new Shell ();
Shell.      Show ();
return shell;
}
protected override Imoduleenumerator Getmoduleenumerator ()
{return
new Staticmoduleenu    Merator ();
}
}

We specify our shell by rewriting the Createshell () method, by overriding the Getmoduleenumerator () method to specify the way our module is loaded (here, in order to compile it, We're going to return to a staticmoduleenumerator, and we'll explain how to configure the module's loading using a configuration file.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.