February 28, 2021
Hot Topics:

Getting Up and Running with the Composite UI Application Block for WPF

  • By Jani Järvinen
  • Send Email »
  • More Articles »

Following the AddServices call, the execution goes to library code that loads the registered modules, and then proceeds to create the main application form, which is in the sample application's case named ShellForm. Here, workspaces are initialized to contain the SmartParts that are to display the application's main controls: an organization chart and a set of fields to edit database data (see Figure 3).

Click here for a larger image.

Figure 3: The sample application running. On the left is a WPF SmartPart displaying an organization chart.

Often, the best way to learn how an application works is to first browse through the source code, and then start running it under the debugger. By stepping the application one code line at a time, you will quickly learn how the application bootstraps, and how control is transferred within the application controls, services, and modules.


In this article, you learned what the Microsoft Composite UI Application Block for WPF (CAB for WPF) is, why it is useful, and how you can get started with one of the sample applications provided in the CAB installation kit.

Although the architecture of CAB is somewhat complex, it is still designed to take complexity away from larger applications. It takes some time to master the inner workings of CAB, but once you are past that phase and actually start using CAB in your own applications, you will notice that you are able to build complicated solutions faster and with less effort.

Once you develop additional applications, it is easier to re-use older code, thanks to the loosely-coupled objects suggested by the block. Thus, the main design goals of CAB—modularity, extensibility, and productivity—are easily met.

If you become a fan of Microsoft's freely-available Patterns & Practices, you also might want to start investigating the other application blocks part of the Smart Client Software Factory (SCSF). For example, the ObjectBuilder and Disconnected Service Agent Application blocks are part of SCSF, and might interest you quite a bit.

But, even though you would only focus on CAB, you have a great set of ready-made classes to support your development efforts. Especially with the recent addition of WPF support, you can start designing applications that use the latest .NET technologies.

Good luck with your adventures in patterns and best practices!

Jani Järvinen


Use these links to download and learn more about the Composite UI Application Block for WPF.

About the Author

Jani Järvinen is a software development trainer and consultant in Finland. He is a Microsoft C# MVP and has written dozens of magazine articles and three books about software development. He is a group leader of a Finnish software development expert group at ITpro.fi. His frequently updated blog can be found at http://www.saunalahti.fi/janij/. You can send him mail by clicking on his name at the top of the article.

Page 3 of 3

This article was originally published on September 29, 2008

Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

Thanks for your registration, follow us on our social networks to keep up-to-date