<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/rss.xsl"?><rss version="2.0"><channel><title>CompositeWPFContrib Wiki &amp; Documentation Rss Feed</title><link>http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Home</link><description>CompositeWPFContrib Wiki Rss Description</description><item><title>Updated Wiki: Home</title><link>http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Home&amp;version=35</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;
Welcome to the Composite WPF Contrib project
&lt;/h1&gt; &lt;br /&gt;Composite WPF Contrib is a community-developed library of extensions to the patterns &amp;amp; practices &lt;a href="/CompositeWPF" class="externalLink"&gt;Composite WPF project&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. &lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;If you are building custom tools and extensions and want to share them then Composite WPF Contrib will get it out to the masses.&lt;/li&gt;&lt;li&gt;If you've got a great idea for new extensions Composite WPF contrib is the place to find developers ready, willing, and able to make it happen.&lt;/li&gt;&lt;li&gt;If you use Composite WPF within your org, then Composite WPF Contrib is the place to find tools and extensions to add to your arsenal.&lt;/li&gt;&lt;li&gt;If you want to connect with others who are pushing the bar on Prism development, then Prism Contrib is the place to be.&lt;/li&gt;
&lt;/ul&gt;Prism contrib is about &lt;b&gt;YOU&lt;/b&gt;. With &lt;b&gt;your&lt;/b&gt; help we can make it a vibrant resource for WPF Composite developers world-wide.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
News
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;(2008-10-26) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;WindowRegionAdapter&lt;/b&gt;. It provides a way to show views in separate windows.&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;(2008-10-16) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;SimpleUnityBootstrapper and CompositeEvent&lt;/b&gt;. Allows you to use modular loading and pub-sub events in Windows Forms or other application types. Also a sample application showing how to use the container to achieve Region-like functionality in Windows Forms. See blog post at &lt;a href="http://briannoyes.net/2008/10/13/CompositeExtensionsForWindowsForms.aspx" class="externalLink"&gt;Brian Noyes Blog&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; for more detailed description.&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;(2008-10-04) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Windsor adapter and bootstrapper&lt;/b&gt;. Allows you to use Castle Windsor IoC with CompositeWPF.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Log4Net logger&lt;/b&gt;. Used by Windsor adapter can be used to log debug and trace info using Log4Net library.&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;(2008-09-13) &lt;b&gt;New Sample&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Presentation Model with DataTemplates in CompositeWPF&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;(2008-09-07) &lt;b&gt;New Sample&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;WPF Quickstart&lt;/b&gt; shipped with the &lt;a href="http://msdn.microsoft.com/en-us/library/aa480482.aspx" class="externalLink"&gt;Smart Client Software Factory&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; regenerated using the &lt;a href="http://msdn.microsoft.com/en-us/library/cc707819.aspx" class="externalLink"&gt;Composite Application Guidance for WPF&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;img src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=43211" alt="RegeneratedWPFQuickstart.png" /&gt;&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;(2008-09-05) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;DialogWorkspace&lt;/b&gt; Show any view as a dialog in your application. Sample is included.&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;(2008-08-11) &lt;b&gt;New Sample&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Sample application&lt;/b&gt; that demonstrate how to use the Disconnected Service Agent Application Block with CompositeWPF&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;img src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=41210" alt="dsa.png" /&gt;&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;(2008-07-31) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;TabGroupPaneRegionAdapter&lt;/b&gt;. Infragistics TabGroupPane Region Adapter for CompositeWPF&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;img src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=40287" alt="TabGroupPaneRegionAdapterMedium.jpg" /&gt;&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;(2008-07-25) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;ExtendedModuleLoaderService&lt;/b&gt;. Extended module loader service with support to install modules on demand using windows installer&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;(2008-07-21) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;OutlookBar&lt;/b&gt;. OutlookBar control and region adapter for CompositeWPF&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;img src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=39481" alt="outlookbar.png" /&gt;&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;(2008-07-17) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Module Status Service&lt;/b&gt;. The Module Status Service can be used to retrieve information about what modules are loaded&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;(2008-07-11) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;CompositeModuleEnumerator&lt;/b&gt;. The CompositeModuleEnumerator makes it possible to combine several module enumerator instances into one module enumerator.&lt;/li&gt;&lt;li&gt;&lt;b&gt;ToolBarPanelRegionAdapter&lt;/b&gt;. This adapter adapts control of type &lt;b&gt;System.Windows.Controls.Primitives.ToolBarPanel&lt;/b&gt; and derived classes.&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;(2008-07-08) &lt;b&gt;New Visual Studio Templates&lt;/b&gt;. The goal of these templates is to help users start with the &lt;a href="/CompositeWPF" class="externalLink"&gt;Composite WPF project&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. &lt;/li&gt;
&lt;/ul&gt; &lt;br /&gt;&lt;h3&gt;
What's in Prism Contrib?
&lt;/h3&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;SimpleUnityBootstrapper and CompositeEvent allowing using of modular loading and events in Windows Forms or other application types&lt;/li&gt;&lt;li&gt;Spring.NET adapter and extensions for CompositeWPF&lt;/li&gt;&lt;li&gt;Castle Windsor adapter and extensions for CompositeWPF&lt;/li&gt;&lt;li&gt;PrismAG - Composite WPF for Silverlight &lt;/li&gt;&lt;li&gt;OutlookBar - OutlookBar control and region adapter for CompositeWPF &lt;/li&gt;&lt;li&gt;CompositeModuleEnumerator - Composite Module Enumerator&lt;/li&gt;&lt;li&gt;Module Status Service - A service that can be used to retrieve information about what modules are loaded&lt;/li&gt;&lt;li&gt;Extended Module Service - An extended module loader service with support to install modules on demand using windows installer&lt;/li&gt;&lt;li&gt;Visual Studio Templates&lt;/li&gt;&lt;li&gt;Composite WPF Extensions - Add-on commands, services, regions, etc to aid you in your Composite WPF development&lt;/li&gt;&lt;li&gt;Infragistics Extensions - Infragistics Extensions for CompositeWPF&lt;/li&gt;&lt;li&gt;Samples&lt;/li&gt;
&lt;/ul&gt;See the &lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Documentation&amp;amp;referringTitle=Home"&gt;Documentation&lt;/a&gt; index for information on how to use each of these extensions and components.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Contributing to Composite WPF Contrib
&lt;/h3&gt;Would you like to join as a developer of the Composite WPF Contrib project to share your own extensions or improve the existing codebase? Great! Here is what you need to know&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.codeplex.com/entlibcontrib/Wiki/View.aspx?title=About%20p%26p%20%22Contrib%22%20projects&amp;amp;referringTitle=Home" class="externalLink"&gt;About p&amp;amp;p &amp;quot;Contrib&amp;quot; projects&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Guidelines%20for%20Composite%20WPF%20Contrib%20code&amp;amp;referringTitle=Home"&gt;Guidelines for Composite WPF Contrib code&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Sign%20Up%20Process&amp;amp;referringTitle=Home"&gt;Sign Up Process&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;
Other p&amp;amp;p Contrib Projects
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="/scsfcontrib" class="externalLink"&gt;Smart Client Contrib&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="/wcsfcontrib" class="externalLink"&gt;Web Client Software Factory Contrib&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="/entlibcontrib" class="externalLink"&gt;Enterprise Library Contrib&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</description><author>ejadib</author><pubDate>Sun, 26 Oct 2008 16:45:06 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20081026044506P</guid></item><item><title>Updated Wiki: Windows Region Adapter</title><link>http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Windows Region Adapter&amp;version=2</link><description>&lt;div class="wikidoc"&gt;
&lt;h2&gt;
Window Region Adapter
&lt;/h2&gt;The &lt;b&gt;WindowRegionAdapter&lt;/b&gt; provides a way to show views in separate windows with a custom style:&lt;br /&gt;&lt;h2&gt;
Important Features
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;It uses a &lt;b&gt;SingleActiveRegion&lt;/b&gt;, so that only one (or no) view (one window) is active at a time. &lt;/li&gt;&lt;li&gt;It provides a &lt;b&gt;WindowStyle&lt;/b&gt; property (of type &lt;b&gt;Style&lt;/b&gt;) which allows the developer to specify a custom style to use as a template for all the windows shown in the region. &lt;/li&gt;
&lt;/ul&gt;&lt;h2&gt;
How to use
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;1 - Register the adapter mapping for the Region Adapter for the type Window:&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;
protected override RegionAdapterMappings ConfigureRegionAdapterMappings() 
{ 
    RegionAdapterMappings regionAdapterMappings = Container.TryResolve&amp;lt;RegionAdapterMappings&amp;gt;();
    if (regionAdapterMappings != null) 
    { 
        regionAdapterMappings.RegisterMapping(typeof(Window), new WindowRegionAdapter()); 
    }
    return base.ConfigureRegionAdapterMappings(); 
}
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;Recommended&lt;/b&gt;: Provide a custom style to use as template for all the windows shown in the region by setting its &lt;b&gt;WindowStyle&lt;/b&gt; property on initialization:&lt;br /&gt;&lt;pre&gt;
regionAdapterMappings.RegisterMapping(typeof(Window), new WindowRegionAdapter() { WindowStyle = (Style 
Application.Current.FindResource(&amp;quot;WindowTemplate&amp;quot;) });
&lt;/pre&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;2 - Add the &lt;b&gt;cal:RegionManager.RegionName&lt;/b&gt; attribute to a Window (for example, the Shell window) to set the owner for the child windows, as follows:&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;
&amp;lt;Window x:Class=&amp;quot;Example.Shell&amp;quot; 
xmlns=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot; 
xmlns:x=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot; 
xmlns:cal=&amp;quot;http://www.codeplex.com/CompositeWPF&amp;quot; 
Title=&amp;quot;MainWindow&amp;quot; Height=&amp;quot;400&amp;quot; Width=&amp;quot;500&amp;quot; WindowStartupLocation=&amp;quot;CenterScreen&amp;quot; 
cal:RegionManager.RegionName=&amp;quot;MyWindowRegion&amp;quot;&amp;gt;
&lt;/pre&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;3 - Display a view as follows:&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;
MyViewPresenter myViewPresenter = myContainer.Resolve&amp;lt;MyViewPresenter&amp;gt;();
_regionManager.Regions[&amp;quot;MyWindowRegion&amp;quot;].Add(myViewPresenter.View);
&lt;/pre&gt; &lt;br /&gt;&lt;h2&gt;
More Information
&lt;/h2&gt;For more information and a sample application, you may visit &lt;a href="http://blogs.southworks.net/ibaumann/2008/09/26/windowregionadapter-for-compositewpf-prism/" class="externalLink"&gt;WindowRegionAdapter for CompositeWPF (Prism)&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;
&lt;/div&gt;</description><author>ejadib</author><pubDate>Sun, 26 Oct 2008 16:44:25 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Windows Region Adapter 20081026044425P</guid></item><item><title>Updated Wiki: Documentation</title><link>http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Documentation&amp;version=11</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;
Documentation
&lt;/h1&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=PrismAG&amp;amp;referringTitle=Documentation"&gt;PrismAG&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=OutlookBar&amp;amp;referringTitle=Documentation"&gt;OutlookBar&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=CompositeModuleEnumerator&amp;amp;referringTitle=Documentation"&gt;Composite Module Enumerator&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Module%20Status%20Service&amp;amp;referringTitle=Documentation"&gt;Module Status Service&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Extended%20Module%20Service&amp;amp;referringTitle=Documentation"&gt;Extended Module Loader Service&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=VisualStudioTemplates&amp;amp;referringTitle=Documentation"&gt;Visual Studio Templates&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=InfragisticsExtensions&amp;amp;referringTitle=Documentation"&gt;Infragistics Extensions&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=DSASampleCompositeWPF&amp;amp;referringTitle=Documentation"&gt;DSA Sample with CompositeWPF&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=DialogWorkspace&amp;amp;referringTitle=Documentation"&gt;Dialog Workspace&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=WPFQuickstartRegeneratedWithCAL&amp;amp;referringTitle=Documentation"&gt;WPF Quickstart Regenerated with Composite Application Library&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=WindsorAndLog4Net&amp;amp;referringTitle=Documentation"&gt;Windsor Adapter, Bootstrapper and Log4Net&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Windows%20Region%20Adapter&amp;amp;referringTitle=Documentation"&gt;Window Region Adapter&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</description><author>ejadib</author><pubDate>Sun, 26 Oct 2008 16:43:54 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Documentation 20081026044354P</guid></item><item><title>Updated Wiki: Windows Region Adapter</title><link>http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Windows Region Adapter&amp;version=1</link><description>&lt;div class="wikidoc"&gt;
&lt;h2&gt;
The WindowRegionAdapter
&lt;/h2&gt;The &lt;b&gt;WindowRegionAdapter&lt;/b&gt; provides a way to show views in separate windows with a custom style:&lt;br /&gt;&lt;h2&gt;
Important Features
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;It uses a &lt;b&gt;SingleActiveRegion&lt;/b&gt;, so that only one (or no) view (one window) is active at a time. &lt;/li&gt;&lt;li&gt;It provides a &lt;b&gt;WindowStyle&lt;/b&gt; property (of type &lt;b&gt;Style&lt;/b&gt;) which allows the developer to specify a custom style to use as a template for all the windows shown in the region. &lt;/li&gt;
&lt;/ul&gt;&lt;h2&gt;
How to use
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;1 - Register the adapter mapping for the Region Adapter for the type Window:&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;
protected override RegionAdapterMappings ConfigureRegionAdapterMappings() 
{ 
    RegionAdapterMappings regionAdapterMappings = Container.TryResolve&amp;lt;RegionAdapterMappings&amp;gt;();
    if (regionAdapterMappings != null) 
    { 
        regionAdapterMappings.RegisterMapping(typeof(Window), new WindowRegionAdapter()); 
    }
    return base.ConfigureRegionAdapterMappings(); 
}
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;Recommended&lt;/b&gt;: Provide a custom style to use as template for all the windows shown in the region by setting its &lt;b&gt;WindowStyle&lt;/b&gt; property on initialization:&lt;br /&gt;&lt;pre&gt;
regionAdapterMappings.RegisterMapping(typeof(Window), new WindowRegionAdapter() { WindowStyle = (Style 
Application.Current.FindResource(&amp;quot;WindowTemplate&amp;quot;) });
&lt;/pre&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;2 - Add the &lt;b&gt;cal:RegionManager.RegionName&lt;/b&gt; attribute to a Window (for example, the Shell window) to set the owner for the child windows, as follows:&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;
&amp;lt;Window x:Class=&amp;quot;Example.Shell&amp;quot; 
xmlns=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot; 
xmlns:x=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot; 
xmlns:cal=&amp;quot;http://www.codeplex.com/CompositeWPF&amp;quot; 
Title=&amp;quot;MainWindow&amp;quot; Height=&amp;quot;400&amp;quot; Width=&amp;quot;500&amp;quot; WindowStartupLocation=&amp;quot;CenterScreen&amp;quot; 
cal:RegionManager.RegionName=&amp;quot;MyWindowRegion&amp;quot;&amp;gt;
&lt;/pre&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;3 - Display a view as follows:&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;
MyViewPresenter myViewPresenter = myContainer.Resolve&amp;lt;MyViewPresenter&amp;gt;();
_regionManager.Regions[&amp;quot;MyWindowRegion&amp;quot;].Add(myViewPresenter.View);
&lt;/pre&gt; &lt;br /&gt;&lt;h2&gt;
More Information
&lt;/h2&gt;For more information and a sample application, you may visit &lt;a href="http://blogs.southworks.net/ibaumann/2008/09/26/windowregionadapter-for-compositewpf-prism/" class="externalLink"&gt;WindowRegionAdapter for CompositeWPF (Prism)&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;
&lt;/div&gt;</description><author>ejadib</author><pubDate>Sun, 26 Oct 2008 16:40:26 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Windows Region Adapter 20081026044026P</guid></item><item><title>Updated Wiki: Documentation</title><link>http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Documentation&amp;version=10</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;
Documentation
&lt;/h1&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=PrismAG&amp;amp;referringTitle=Documentation"&gt;PrismAG&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=OutlookBar&amp;amp;referringTitle=Documentation"&gt;OutlookBar&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=CompositeModuleEnumerator&amp;amp;referringTitle=Documentation"&gt;Composite Module Enumerator&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Module%20Status%20Service&amp;amp;referringTitle=Documentation"&gt;Module Status Service&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Extended%20Module%20Service&amp;amp;referringTitle=Documentation"&gt;Extended Module Loader Service&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=VisualStudioTemplates&amp;amp;referringTitle=Documentation"&gt;Visual Studio Templates&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=InfragisticsExtensions&amp;amp;referringTitle=Documentation"&gt;Infragistics Extensions&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=DSASampleCompositeWPF&amp;amp;referringTitle=Documentation"&gt;DSA Sample with CompositeWPF&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=DialogWorkspace&amp;amp;referringTitle=Documentation"&gt;Dialog Workspace&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=WPFQuickstartRegeneratedWithCAL&amp;amp;referringTitle=Documentation"&gt;WPF Quickstart Regenerated with Composite Application Library&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=WindsorAndLog4Net&amp;amp;referringTitle=Documentation"&gt;Windsor Adapter, Bootstrapper and Log4Net&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Windows%20Region%20Adapter&amp;amp;referringTitle=Documentation"&gt;Windows Region Adapter&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</description><author>ejadib</author><pubDate>Sun, 26 Oct 2008 16:35:29 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Documentation 20081026043529P</guid></item><item><title>Updated Wiki: Documentation</title><link>http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Documentation&amp;version=9</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;
Documentation
&lt;/h1&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=PrismAG&amp;amp;referringTitle=Documentation"&gt;PrismAG&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=OutlookBar&amp;amp;referringTitle=Documentation"&gt;OutlookBar&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=CompositeModuleEnumerator&amp;amp;referringTitle=Documentation"&gt;Composite Module Enumerator&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Module%20Status%20Service&amp;amp;referringTitle=Documentation"&gt;Module Status Service&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Extended%20Module%20Service&amp;amp;referringTitle=Documentation"&gt;Extended Module Loader Service&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=VisualStudioTemplates&amp;amp;referringTitle=Documentation"&gt;Visual Studio Templates&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=InfragisticsExtensions&amp;amp;referringTitle=Documentation"&gt;Infragistics Extensions&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=DSASampleCompositeWPF&amp;amp;referringTitle=Documentation"&gt;DSA Sample with CompositeWPF&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=DialogWorkspace&amp;amp;referringTitle=Documentation"&gt;Dialog Workspace&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=WPFQuickstartRegeneratedWithCAL&amp;amp;referringTitle=Documentation"&gt;WPF Quickstart Regenerated with Composite Application Library&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=WindsorAndLog4Net&amp;amp;referringTitle=Documentation"&gt;Windsor Adapter, Bootstrapper and Log4Net&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=WindowsRegionAdapter&amp;amp;referringTitle=Documentation"&gt;WindowsRegionAdapter&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</description><author>ejadib</author><pubDate>Sun, 26 Oct 2008 16:34:59 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Documentation 20081026043459P</guid></item><item><title>Updated Wiki: Home</title><link>http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Home&amp;version=34</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;
Welcome to the Composite WPF Contrib project
&lt;/h1&gt; &lt;br /&gt;Composite WPF Contrib is a community-developed library of extensions to the patterns &amp;amp; practices &lt;a href="/CompositeWPF" class="externalLink"&gt;Composite WPF project&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. &lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;If you are building custom tools and extensions and want to share them then Composite WPF Contrib will get it out to the masses.&lt;/li&gt;&lt;li&gt;If you've got a great idea for new extensions Composite WPF contrib is the place to find developers ready, willing, and able to make it happen.&lt;/li&gt;&lt;li&gt;If you use Composite WPF within your org, then Composite WPF Contrib is the place to find tools and extensions to add to your arsenal.&lt;/li&gt;&lt;li&gt;If you want to connect with others who are pushing the bar on Prism development, then Prism Contrib is the place to be.&lt;/li&gt;
&lt;/ul&gt;Prism contrib is about &lt;b&gt;YOU&lt;/b&gt;. With &lt;b&gt;your&lt;/b&gt; help we can make it a vibrant resource for WPF Composite developers world-wide.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
News
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;(2008-10-26) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;WindowsRegionAdapter&lt;/b&gt;. It provides a way to show views in separate windows.&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;(2008-10-16) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;SimpleUnityBootstrapper and CompositeEvent&lt;/b&gt;. Allows you to use modular loading and pub-sub events in Windows Forms or other application types. Also a sample application showing how to use the container to achieve Region-like functionality in Windows Forms. See blog post at &lt;a href="http://briannoyes.net/2008/10/13/CompositeExtensionsForWindowsForms.aspx" class="externalLink"&gt;Brian Noyes Blog&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; for more detailed description.&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;(2008-10-04) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Windsor adapter and bootstrapper&lt;/b&gt;. Allows you to use Castle Windsor IoC with CompositeWPF.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Log4Net logger&lt;/b&gt;. Used by Windsor adapter can be used to log debug and trace info using Log4Net library.&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;(2008-09-13) &lt;b&gt;New Sample&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Presentation Model with DataTemplates in CompositeWPF&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;(2008-09-07) &lt;b&gt;New Sample&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;WPF Quickstart&lt;/b&gt; shipped with the &lt;a href="http://msdn.microsoft.com/en-us/library/aa480482.aspx" class="externalLink"&gt;Smart Client Software Factory&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; regenerated using the &lt;a href="http://msdn.microsoft.com/en-us/library/cc707819.aspx" class="externalLink"&gt;Composite Application Guidance for WPF&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;img src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=43211" alt="RegeneratedWPFQuickstart.png" /&gt;&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;(2008-09-05) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;DialogWorkspace&lt;/b&gt; Show any view as a dialog in your application. Sample is included.&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;(2008-08-11) &lt;b&gt;New Sample&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Sample application&lt;/b&gt; that demonstrate how to use the Disconnected Service Agent Application Block with CompositeWPF&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;img src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=41210" alt="dsa.png" /&gt;&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;(2008-07-31) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;TabGroupPaneRegionAdapter&lt;/b&gt;. Infragistics TabGroupPane Region Adapter for CompositeWPF&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;img src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=40287" alt="TabGroupPaneRegionAdapterMedium.jpg" /&gt;&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;(2008-07-25) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;ExtendedModuleLoaderService&lt;/b&gt;. Extended module loader service with support to install modules on demand using windows installer&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;(2008-07-21) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;OutlookBar&lt;/b&gt;. OutlookBar control and region adapter for CompositeWPF&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;img src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=39481" alt="outlookbar.png" /&gt;&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;(2008-07-17) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Module Status Service&lt;/b&gt;. The Module Status Service can be used to retrieve information about what modules are loaded&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;(2008-07-11) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;CompositeModuleEnumerator&lt;/b&gt;. The CompositeModuleEnumerator makes it possible to combine several module enumerator instances into one module enumerator.&lt;/li&gt;&lt;li&gt;&lt;b&gt;ToolBarPanelRegionAdapter&lt;/b&gt;. This adapter adapts control of type &lt;b&gt;System.Windows.Controls.Primitives.ToolBarPanel&lt;/b&gt; and derived classes.&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;(2008-07-08) &lt;b&gt;New Visual Studio Templates&lt;/b&gt;. The goal of these templates is to help users start with the &lt;a href="/CompositeWPF" class="externalLink"&gt;Composite WPF project&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. &lt;/li&gt;
&lt;/ul&gt; &lt;br /&gt;&lt;h3&gt;
What's in Prism Contrib?
&lt;/h3&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;SimpleUnityBootstrapper and CompositeEvent allowing using of modular loading and events in Windows Forms or other application types&lt;/li&gt;&lt;li&gt;Spring.NET adapter and extensions for CompositeWPF&lt;/li&gt;&lt;li&gt;Castle Windsor adapter and extensions for CompositeWPF&lt;/li&gt;&lt;li&gt;PrismAG - Composite WPF for Silverlight &lt;/li&gt;&lt;li&gt;OutlookBar - OutlookBar control and region adapter for CompositeWPF &lt;/li&gt;&lt;li&gt;CompositeModuleEnumerator - Composite Module Enumerator&lt;/li&gt;&lt;li&gt;Module Status Service - A service that can be used to retrieve information about what modules are loaded&lt;/li&gt;&lt;li&gt;Extended Module Service - An extended module loader service with support to install modules on demand using windows installer&lt;/li&gt;&lt;li&gt;Visual Studio Templates&lt;/li&gt;&lt;li&gt;Composite WPF Extensions - Add-on commands, services, regions, etc to aid you in your Composite WPF development&lt;/li&gt;&lt;li&gt;Infragistics Extensions - Infragistics Extensions for CompositeWPF&lt;/li&gt;&lt;li&gt;Samples&lt;/li&gt;
&lt;/ul&gt;See the &lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Documentation&amp;amp;referringTitle=Home"&gt;Documentation&lt;/a&gt; index for information on how to use each of these extensions and components.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Contributing to Composite WPF Contrib
&lt;/h3&gt;Would you like to join as a developer of the Composite WPF Contrib project to share your own extensions or improve the existing codebase? Great! Here is what you need to know&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.codeplex.com/entlibcontrib/Wiki/View.aspx?title=About%20p%26p%20%22Contrib%22%20projects&amp;amp;referringTitle=Home" class="externalLink"&gt;About p&amp;amp;p &amp;quot;Contrib&amp;quot; projects&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Guidelines%20for%20Composite%20WPF%20Contrib%20code&amp;amp;referringTitle=Home"&gt;Guidelines for Composite WPF Contrib code&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Sign%20Up%20Process&amp;amp;referringTitle=Home"&gt;Sign Up Process&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;
Other p&amp;amp;p Contrib Projects
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="/scsfcontrib" class="externalLink"&gt;Smart Client Contrib&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="/wcsfcontrib" class="externalLink"&gt;Web Client Software Factory Contrib&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="/entlibcontrib" class="externalLink"&gt;Enterprise Library Contrib&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</description><author>ejadib</author><pubDate>Sun, 26 Oct 2008 16:33:37 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20081026043337P</guid></item><item><title>Updated Wiki: Home</title><link>http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Home&amp;version=33</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;
Welcome to the Composite WPF Contrib project
&lt;/h1&gt; &lt;br /&gt;Composite WPF Contrib is a community-developed library of extensions to the patterns &amp;amp; practices &lt;a href="/CompositeWPF" class="externalLink"&gt;Composite WPF project&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. &lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;If you are building custom tools and extensions and want to share them then Composite WPF Contrib will get it out to the masses.&lt;/li&gt;&lt;li&gt;If you've got a great idea for new extensions Composite WPF contrib is the place to find developers ready, willing, and able to make it happen.&lt;/li&gt;&lt;li&gt;If you use Composite WPF within your org, then Composite WPF Contrib is the place to find tools and extensions to add to your arsenal.&lt;/li&gt;&lt;li&gt;If you want to connect with others who are pushing the bar on Prism development, then Prism Contrib is the place to be.&lt;/li&gt;
&lt;/ul&gt;Prism contrib is about &lt;b&gt;YOU&lt;/b&gt;. With &lt;b&gt;your&lt;/b&gt; help we can make it a vibrant resource for WPF Composite developers world-wide.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
News
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;(2008-10-16) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;SimpleUnityBootstrapper and CompositeEvent&lt;/b&gt;. Allows you to use modular loading and pub-sub events in Windows Forms or other application types. Also a sample application showing how to use the container to achieve Region-like functionality in Windows Forms. See blog post at &lt;a href="http://briannoyes.net/2008/10/13/CompositeExtensionsForWindowsForms.aspx" class="externalLink"&gt;Brian Noyes Blog&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; for more detailed description.&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;(2008-10-04) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Windosr adapter and bootstrapper&lt;/b&gt;. Allows you to use Castle Windsor IoC with CompositeWPF.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Log4Net logger&lt;/b&gt;. Used by Windsor adapter can be used to log debug and trace info using Log4Net library.&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;(2008-09-13) &lt;b&gt;New Sample&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Presentation Model with DataTemplates in CompositeWPF&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;(2008-09-07) &lt;b&gt;New Sample&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;WPF Quickstart&lt;/b&gt; shipped with the &lt;a href="http://msdn.microsoft.com/en-us/library/aa480482.aspx" class="externalLink"&gt;Smart Client Software Factory&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; regenerated using the &lt;a href="http://msdn.microsoft.com/en-us/library/cc707819.aspx" class="externalLink"&gt;Composite Application Guidance for WPF&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;img src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=43211" alt="RegeneratedWPFQuickstart.png" /&gt;&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;(2008-09-05) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;DialogWorkspace&lt;/b&gt; Show any view as a dialog in your application. Sample is included.&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;(2008-08-11) &lt;b&gt;New Sample&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Sample application&lt;/b&gt; that demonstrate how to use the Disconnected Service Agent Application Block with CompositeWPF&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;img src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=41210" alt="dsa.png" /&gt;&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;(2008-07-31) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;TabGroupPaneRegionAdapter&lt;/b&gt;. Infragistics TabGroupPane Region Adapter for CompositeWPF&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;img src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=40287" alt="TabGroupPaneRegionAdapterMedium.jpg" /&gt;&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;(2008-07-25) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;ExtendedModuleLoaderService&lt;/b&gt;. Extended module loader service with support to install modules on demand using windows installer&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;(2008-07-21) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;OutlookBar&lt;/b&gt;. OutlookBar control and region adapter for CompositeWPF&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;img src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=39481" alt="outlookbar.png" /&gt;&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;(2008-07-17) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Module Status Service&lt;/b&gt;. The Module Status Service can be used to retrieve information about what modules are loaded&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;(2008-07-11) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;CompositeModuleEnumerator&lt;/b&gt;. The CompositeModuleEnumerator makes it possible to combine several module enumerator instances into one module enumerator.&lt;/li&gt;&lt;li&gt;&lt;b&gt;ToolBarPanelRegionAdapter&lt;/b&gt;. This adapter adapts control of type &lt;b&gt;System.Windows.Controls.Primitives.ToolBarPanel&lt;/b&gt; and derived classes.&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;(2008-07-08) &lt;b&gt;New Visual Studio Templates&lt;/b&gt;. The goal of these templates is to help users start with the &lt;a href="/CompositeWPF" class="externalLink"&gt;Composite WPF project&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. &lt;/li&gt;
&lt;/ul&gt; &lt;br /&gt;&lt;h3&gt;
What's in Prism Contrib?
&lt;/h3&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;SimpleUnityBootstrapper and CompositeEvent allowing using of modular loading and events in Windows Forms or other application types&lt;/li&gt;&lt;li&gt;Spring.NET adapter and extensions for CompositeWPF&lt;/li&gt;&lt;li&gt;Castle Windsor adapter and extensions for CompositeWPF&lt;/li&gt;&lt;li&gt;PrismAG - Composite WPF for Silverlight &lt;/li&gt;&lt;li&gt;OutlookBar - OutlookBar control and region adapter for CompositeWPF &lt;/li&gt;&lt;li&gt;CompositeModuleEnumerator - Composite Module Enumerator&lt;/li&gt;&lt;li&gt;Module Status Service - A service that can be used to retrieve information about what modules are loaded&lt;/li&gt;&lt;li&gt;Extended Module Service - An extended module loader service with support to install modules on demand using windows installer&lt;/li&gt;&lt;li&gt;Visual Studio Templates&lt;/li&gt;&lt;li&gt;Composite WPF Extensions - Add-on commands, services, regions, etc to aid you in your Composite WPF development&lt;/li&gt;&lt;li&gt;Infragistics Extensions - Infragistics Extensions for CompositeWPF&lt;/li&gt;&lt;li&gt;Samples&lt;/li&gt;
&lt;/ul&gt;See the &lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Documentation&amp;amp;referringTitle=Home"&gt;Documentation&lt;/a&gt; index for information on how to use each of these extensions and components.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Contributing to Composite WPF Contrib
&lt;/h3&gt;Would you like to join as a developer of the Composite WPF Contrib project to share your own extensions or improve the existing codebase? Great! Here is what you need to know&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.codeplex.com/entlibcontrib/Wiki/View.aspx?title=About%20p%26p%20%22Contrib%22%20projects&amp;amp;referringTitle=Home" class="externalLink"&gt;About p&amp;amp;p &amp;quot;Contrib&amp;quot; projects&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Guidelines%20for%20Composite%20WPF%20Contrib%20code&amp;amp;referringTitle=Home"&gt;Guidelines for Composite WPF Contrib code&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Sign%20Up%20Process&amp;amp;referringTitle=Home"&gt;Sign Up Process&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;
Other p&amp;amp;p Contrib Projects
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="/scsfcontrib" class="externalLink"&gt;Smart Client Contrib&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="/wcsfcontrib" class="externalLink"&gt;Web Client Software Factory Contrib&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="/entlibcontrib" class="externalLink"&gt;Enterprise Library Contrib&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</description><author>BrianNoyes</author><pubDate>Thu, 16 Oct 2008 15:36:16 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20081016033616P</guid></item><item><title>Updated Wiki: WindsorAndLog4Net</title><link>http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=WindsorAndLog4Net&amp;version=2</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;
Windsor Bootstrapper and Log4Net
&lt;/h1&gt;&lt;h2&gt;
Introduction
&lt;/h2&gt;CompositeWPF comes uses Unity as default dependency injection container, but you can replace the default container and use other containers too. Here we see how to use Castle Windsor container and use Log4Net library as our logging mechanism.&lt;br /&gt; &lt;br /&gt;&lt;h2&gt;
Using Boostrapper
&lt;/h2&gt;There is an abstract WindsorBootstrapper which you need to inherit from : &lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
public class Bootstrapper : WindsorBootstrapper
{
    private IWindsorContainer container;
 
    public Bootstrapper() : this(new WindsorContainer())
    {
    }
 
    public Bootstrapper(IWindsorContainer container)
    {
        this.container = container;
    }
 
    protected override IWindsorContainer CreateContainer()
    {
        return container;
    }
}
&lt;/pre&gt; &lt;br /&gt; &lt;br /&gt;After when interfacing with IWindsorContainer, you can use generic extension methods provided to you in &lt;i&gt;WindsorContainerExtensions&lt;/i&gt; class : &lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
using CompositeWPFContrib.Composite.WindsorExtensions;
 
[Singleton]
public class OrderService : IOrderService
{
    public void AcceptOrder(string orderName)
    {
        var serviceInstance = Container.TryResolve&amp;lt;IOrderProcessService&amp;gt;();
        serviceInstance.Process(orderName);
    }
}
&lt;/pre&gt; &lt;br /&gt; &lt;br /&gt;&lt;h2&gt;
Using Log4Net Logger
&lt;/h2&gt;When using WindsorBootstrapper, an instance of ILoggerFacade implemented using Log4Net is already registered for you. To start logging, all you need is to configure Log4Net, either with configuration files or via code when starting the application, and later get an instance of ILoggerFacade, either via Constructor injection or Service Lookup, and perform the actual logging. Please note that, since Log4Net does not have a notion of &lt;i&gt;Priorities&lt;/i&gt; and only supports &lt;i&gt;Categories&lt;/i&gt; when logging, all the specified priorities will be ignored.&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
[Singleton]
public class OrderService : IOrderService
{
    private ILoggerFacade logger;
    private IWindsorContainer container;
 
    public OrderService(IWindsorContainer container, ILoggerFacade logger)
    {
        this.container = container;
        this.logger = logger;
    }
 
    public void AcceptOrder(string orderName)
    {
        logger.Log(&amp;quot;Getting Order Process service&amp;quot;, Category.Debug, Priority.High);
        var serviceInstance = container.TryResolve&amp;lt;IOrderProcessService&amp;gt;();
 
        logger.Log(&amp;quot;Processing the order&amp;quot;, Category.Info, Priority.Low);
        serviceInstance.Process(orderName);
    }
}
&lt;/pre&gt; &lt;br /&gt; &lt;br /&gt;&lt;h2&gt;
Using Windsor Adapter
&lt;/h2&gt;When using CompositeWPF, there are a lot of times when you need to interact with the IoC container. To avoid coupling to specific container, you'd better stick to IContainerFacade implementation provided to you. This will help a lot in case you need to switch to another IoC container. When using WindsorBootstrapper an instance of IContainerFacade implemented using Windsor is registered for you. So, instead of using IWindsorContainer interface or implementation directly, it is advised to use IContainerFacade :&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
[Singleton]
public class OrderService : IOrderService
{
    private IContainerFacade container;
 
    public OrderService(IContainerFacade container)
    {
        this.container = container;
    }
 
    public void AcceptOrder(string orderName)
    {
        var serviceInstance = container.TryResolve(typeof(IOrderProcessService));
        serviceInstance.Process(orderName);
    }
}
&lt;/pre&gt; &lt;br /&gt;
&lt;/div&gt;</description><author>HEskandari</author><pubDate>Sat, 04 Oct 2008 09:16:51 GMT</pubDate><guid isPermaLink="false">Updated Wiki: WindsorAndLog4Net 20081004091651A</guid></item><item><title>Updated Wiki: WindsorAndLog4Net</title><link>http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=WindsorAndLog4Net&amp;version=1</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;
Windsor Bootstrapper and Log4Net
&lt;/h1&gt;&lt;h2&gt;
Introduction
&lt;/h2&gt;CompositeWPF comes uses Unity as default dependency injection container, but you can replace the default container and use other containers too. Here we see how to use Castle Windsor container and use Log4Net library as our logging mechanism.&lt;br /&gt; &lt;br /&gt;&lt;h2&gt;
Using Boostrapper
&lt;/h2&gt;There is an abstract WindsorBootstrapper which you need to inherit from : &lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
public class Bootstrapper : WindsorBootstrapper
{
    private IWindsorContainer container;
 
    public Bootstrapper() : this(new WindsorContainer())
    {
    }
 
    public Bootstrapper(IWindsorContainer container)
    {
        this.container = container;
    }
 
    protected override IWindsorContainer CreateContainer()
    {
        return container;
    }
}
&lt;/pre&gt; &lt;br /&gt; &lt;br /&gt;After when interfacing with IWindsorContainer, you can use generic extension methods provided to you in &lt;i&gt;WindsorContainerExtensions&lt;/i&gt; class : &lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
using CompositeWPFContrib.Composite.WindsorExtensions;
 
[Singleton]
public class OrderService : IOrderService
{
    public void AcceptOrder(string orderName)
    {
        var serviceInstance = Container.TryResolve&amp;lt;IOrderProcessService&amp;gt;();
        serviceInstance.Process(orderName);
    }
}
&lt;/pre&gt; &lt;br /&gt; &lt;br /&gt;&lt;h2&gt;
Using Log4Net Logger
&lt;/h2&gt;When using WindsorBootstrapper, an instance of ILoggerFacade implemented using Log4Net is already registered for you. To start logging, all you need is to configure Log4Net, either with configuration files or via code when starting the application, and later get an instance of ILoggerFacade, either via Constructor injection or Service Lookup, and perform the actual logging. Please note that, since Log4Net does not have a notion of &lt;i&gt;Priorities&lt;/i&gt; and only supports &lt;i&gt;Categories&lt;/i&gt; when logging, all the specified priorities will be ignored.&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
[Singleton]
public class OrderService : IOrderService
{
    private ILoggerFacade logger;
    private IWindsorContainer container;
 
    public OrderService(IWindsorContainer container, ILoggerFacade logger)
    {
        this.container = container;
        this.logger = logger;
    }
 
    public void AcceptOrder(string orderName)
    {
        logger.Log(&amp;quot;Getting Order Process service&amp;quot;, Category.Debug, Priority.High);
        var serviceInstance = container.TryResolve&amp;lt;IOrderProcessService&amp;gt;();
 
        logger.Log(&amp;quot;Processing the order&amp;quot;, Category.Info, Priority.Low);
        serviceInstance.Process(orderName);
    }
}
&lt;/pre&gt; &lt;br /&gt; &lt;br /&gt;&lt;h2&gt;
Using Windsor Adapter
&lt;/h2&gt;When using CompositeWPF, there are a lot of times when you need to interact with the IoC container. To avoid coupling to specific container, you'd better stick to IContainerFacade implementation provided to you. This will help a lot in case you need to switch to another container. When using WindsorBootstrapper an instance of IContainerFacade implemented using Windsor is registered for you. So, instead of using IWindsorContainer interface or implementation directly, it is advised to use IContainerFacade :&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
[Singleton]
public class OrderService : IOrderService
{
    private IContainerFacade container;
 
    public OrderService(IContainerFacade container)
    {
        this.container = container;
    }
 
    public void AcceptOrder(string orderName)
    {
        var serviceInstance = container.TryResolve(typeof(IOrderProcessService));
        serviceInstance.Process(orderName);
    }
}
&lt;/pre&gt; &lt;br /&gt;
&lt;/div&gt;</description><author>HEskandari</author><pubDate>Sat, 04 Oct 2008 09:15:09 GMT</pubDate><guid isPermaLink="false">Updated Wiki: WindsorAndLog4Net 20081004091509A</guid></item><item><title>Updated Wiki: Documentation</title><link>http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Documentation&amp;version=8</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;
Documentation
&lt;/h1&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=PrismAG&amp;amp;referringTitle=Documentation"&gt;PrismAG&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=OutlookBar&amp;amp;referringTitle=Documentation"&gt;OutlookBar&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=CompositeModuleEnumerator&amp;amp;referringTitle=Documentation"&gt;Composite Module Enumerator&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Module%20Status%20Service&amp;amp;referringTitle=Documentation"&gt;Module Status Service&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Extended%20Module%20Service&amp;amp;referringTitle=Documentation"&gt;Extended Module Loader Service&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=VisualStudioTemplates&amp;amp;referringTitle=Documentation"&gt;Visual Studio Templates&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=InfragisticsExtensions&amp;amp;referringTitle=Documentation"&gt;Infragistics Extensions&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=DSASampleCompositeWPF&amp;amp;referringTitle=Documentation"&gt;DSA Sample with CompositeWPF&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=DialogWorkspace&amp;amp;referringTitle=Documentation"&gt;Dialog Workspace&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=WPFQuickstartRegeneratedWithCAL&amp;amp;referringTitle=Documentation"&gt;WPF Quickstart Regenerated with Composite Application Library&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=WindsorAndLog4Net&amp;amp;referringTitle=Documentation"&gt;Windsor Adapter, Bootstrapper and Log4Net&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</description><author>HEskandari</author><pubDate>Sat, 04 Oct 2008 07:16:29 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Documentation 20081004071629A</guid></item><item><title>Updated Wiki: Home</title><link>http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Home&amp;version=32</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;
Welcome to the Composite WPF Contrib project
&lt;/h1&gt; &lt;br /&gt;Composite WPF Contrib is a community-developed library of extensions to the patterns &amp;amp; practices &lt;a href="/CompositeWPF" class="externalLink"&gt;Composite WPF project&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. &lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;If you are building custom tools and extensions and want to share them then Composite WPF Contrib will get it out to the masses.&lt;/li&gt;&lt;li&gt;If you've got a great idea for new extensions Composite WPF contrib is the place to find developers ready, willing, and able to make it happen.&lt;/li&gt;&lt;li&gt;If you use Composite WPF within your org, then Composite WPF Contrib is the place to find tools and extensions to add to your arsenal.&lt;/li&gt;&lt;li&gt;If you want to connect with others who are pushing the bar on Prism development, then Prism Contrib is the place to be.&lt;/li&gt;
&lt;/ul&gt;Prism contrib is about &lt;b&gt;YOU&lt;/b&gt;. With &lt;b&gt;your&lt;/b&gt; help we can make it a vibrant resource for WPF Composite developers world-wide.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
News
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;(2008-10-04) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Windosr adapter and bootstrapper&lt;/b&gt;. Allows you to use Castle Windsor IoC with CompositeWPF.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Log4Net logger&lt;/b&gt;. Used by Windsor adapter can be used to log debug and trace info using Log4Net library.&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;(2008-09-13) &lt;b&gt;New Sample&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Presentation Model with DataTemplates in CompositeWPF&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;(2008-09-07) &lt;b&gt;New Sample&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;WPF Quickstart&lt;/b&gt; shipped with the &lt;a href="http://msdn.microsoft.com/en-us/library/aa480482.aspx" class="externalLink"&gt;Smart Client Software Factory&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; regenerated using the &lt;a href="http://msdn.microsoft.com/en-us/library/cc707819.aspx" class="externalLink"&gt;Composite Application Guidance for WPF&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=43211" alt="RegeneratedWPFQuickstart.png" /&gt;&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;(2008-09-05) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;DialogWorkspace&lt;/b&gt; Show any view as a dialog in your application. Sample is included.&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;(2008-08-11) &lt;b&gt;New Sample&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Sample application&lt;/b&gt; that demonstrate how to use the Disconnected Service Agent Application Block with CompositeWPF&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=41210" alt="dsa.png" /&gt;&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;(2008-07-31) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;TabGroupPaneRegionAdapter&lt;/b&gt;. Infragistics TabGroupPane Region Adapter for CompositeWPF&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=40287" alt="TabGroupPaneRegionAdapterMedium.jpg" /&gt;&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;(2008-07-25) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;ExtendedModuleLoaderService&lt;/b&gt;. Extended module loader service with support to install modules on demand using windows installer&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;(2008-07-21) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;OutlookBar&lt;/b&gt;. OutlookBar control and region adapter for CompositeWPF&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=39481" alt="outlookbar.png" /&gt;&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;(2008-07-17) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Module Status Service&lt;/b&gt;. The Module Status Service can be used to retrieve information about what modules are loaded&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;(2008-07-11) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;CompositeModuleEnumerator&lt;/b&gt;. The CompositeModuleEnumerator makes it possible to combine several module enumerator instances into one module enumerator.&lt;/li&gt;&lt;li&gt;&lt;b&gt;ToolBarPanelRegionAdapter&lt;/b&gt;. This adapter adapts control of type &lt;b&gt;System.Windows.Controls.Primitives.ToolBarPanel&lt;/b&gt; and derived classes.&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;(2008-07-08) &lt;b&gt;New Visual Studio Templates&lt;/b&gt;. The goal of these templates is to help users start with the &lt;a href="/CompositeWPF" class="externalLink"&gt;Composite WPF project&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. &lt;/li&gt;
&lt;/ul&gt; &lt;br /&gt;&lt;h3&gt;
What's in Prism Contrib?
&lt;/h3&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;Spring.NET adapter and extensions for CompositeWPF&lt;/li&gt;&lt;li&gt;Castle Windsor adapter and extensions for CompositeWPF&lt;/li&gt;&lt;li&gt;PrismAG - Composite WPF for Silverlight &lt;/li&gt;&lt;li&gt;OutlookBar - OutlookBar control and region adapter for CompositeWPF &lt;/li&gt;&lt;li&gt;CompositeModuleEnumerator - Composite Module Enumerator&lt;/li&gt;&lt;li&gt;Module Status Service - A service that can be used to retrieve information about what modules are loaded&lt;/li&gt;&lt;li&gt;Extended Module Service - An extended module loader service with support to install modules on demand using windows installer&lt;/li&gt;&lt;li&gt;Visual Studio Templates&lt;/li&gt;&lt;li&gt;Composite WPF Extensions - Add-on commands, services, regions, etc to aid you in your Composite WPF development&lt;/li&gt;&lt;li&gt;Infragistics Extensions - Infragistics Extensions for CompositeWPF&lt;/li&gt;&lt;li&gt;Samples&lt;/li&gt;
&lt;/ul&gt;See the &lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Documentation&amp;amp;referringTitle=Home"&gt;Documentation&lt;/a&gt; index for information on how to use each of these extensions and components.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Contributing to Composite WPF Contrib
&lt;/h3&gt;Would you like to join as a developer of the Composite WPF Contrib project to share your own extensions or improve the existing codebase? Great! Here is what you need to know&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.codeplex.com/entlibcontrib/Wiki/View.aspx?title=About%20p%26p%20%22Contrib%22%20projects&amp;amp;referringTitle=Home" class="externalLink"&gt;About p&amp;amp;p &amp;quot;Contrib&amp;quot; projects&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Guidelines%20for%20Composite%20WPF%20Contrib%20code&amp;amp;referringTitle=Home"&gt;Guidelines for Composite WPF Contrib code&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Sign%20Up%20Process&amp;amp;referringTitle=Home"&gt;Sign Up Process&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;
Other p&amp;amp;p Contrib Projects
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="/scsfcontrib" class="externalLink"&gt;Smart Client Contrib&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="/wcsfcontrib" class="externalLink"&gt;Web Client Software Factory Contrib&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="/entlibcontrib" class="externalLink"&gt;Enterprise Library Contrib&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</description><author>HEskandari</author><pubDate>Sat, 04 Oct 2008 07:12:57 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20081004071257A</guid></item><item><title>Updated Wiki: Home</title><link>http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Home&amp;version=31</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;
Welcome to the Composite WPF Contrib project
&lt;/h1&gt; &lt;br /&gt;Composite WPF Contrib is a community-developed library of extensions to the patterns &amp;amp; practices &lt;a href="/CompositeWPF" class="externalLink"&gt;Composite WPF project&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. &lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;If you are building custom tools and extensions and want to share them then Composite WPF Contrib will get it out to the masses.&lt;/li&gt;&lt;li&gt;If you've got a great idea for new extensions Composite WPF contrib is the place to find developers ready, willing, and able to make it happen.&lt;/li&gt;&lt;li&gt;If you use Composite WPF within your org, then Composite WPF Contrib is the place to find tools and extensions to add to your arsenal.&lt;/li&gt;&lt;li&gt;If you want to connect with others who are pushing the bar on Prism development, then Prism Contrib is the place to be.&lt;/li&gt;
&lt;/ul&gt;Prism contrib is about &lt;b&gt;YOU&lt;/b&gt;. With &lt;b&gt;your&lt;/b&gt; help we can make it a vibrant resource for WPF Composite developers world-wide.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
News
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;(2008-09-13) &lt;b&gt;New Sample&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Presentation Model with DataTemplates in CompositeWPF&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;(2008-09-07) &lt;b&gt;New Sample&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;WPF Quickstart&lt;/b&gt; shipped with the &lt;a href="http://msdn.microsoft.com/en-us/library/aa480482.aspx" class="externalLink"&gt;Smart Client Software Factory&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; regenerated using the &lt;a href="http://msdn.microsoft.com/en-us/library/cc707819.aspx" class="externalLink"&gt;Composite Application Guidance for WPF&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=43211" alt="RegeneratedWPFQuickstart.png" /&gt;&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;(2008-09-05) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;DialogWorkspace&lt;/b&gt; Show any view as a dialog in your application. Sample is included.&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;(2008-08-11) &lt;b&gt;New Sample&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Sample application&lt;/b&gt; that demonstrate how to use the Disconnected Service Agent Application Block with CompositeWPF&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=41210" alt="dsa.png" /&gt;&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;(2008-07-31) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;TabGroupPaneRegionAdapter&lt;/b&gt;. Infragistics TabGroupPane Region Adapter for CompositeWPF&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=40287" alt="TabGroupPaneRegionAdapterMedium.jpg" /&gt;&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;(2008-07-25) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;ExtendedModuleLoaderService&lt;/b&gt;. Extended module loader service with support to install modules on demand using windows installer&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;(2008-07-21) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;OutlookBar&lt;/b&gt;. OutlookBar control and region adapter for CompositeWPF&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=39481" alt="outlookbar.png" /&gt;&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;(2008-07-17) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Module Status Service&lt;/b&gt;. The Module Status Service can be used to retrieve information about what modules are loaded&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;(2008-07-11) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;CompositeModuleEnumerator&lt;/b&gt;. The CompositeModuleEnumerator makes it possible to combine several module enumerator instances into one module enumerator.&lt;/li&gt;&lt;li&gt;&lt;b&gt;ToolBarPanelRegionAdapter&lt;/b&gt;. This adapter adapts control of type &lt;b&gt;System.Windows.Controls.Primitives.ToolBarPanel&lt;/b&gt; and derived classes.&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;(2008-07-08) &lt;b&gt;New Visual Studio Templates&lt;/b&gt;. The goal of these templates is to help users start with the &lt;a href="/CompositeWPF" class="externalLink"&gt;Composite WPF project&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. &lt;/li&gt;
&lt;/ul&gt; &lt;br /&gt;&lt;h3&gt;
What's in Prism Contrib?
&lt;/h3&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;PrismAG - Composite WPF for Silverlight &lt;/li&gt;&lt;li&gt;OutlookBar - OutlookBar control and region adapter for CompositeWPF &lt;/li&gt;&lt;li&gt;CompositeModuleEnumerator - Composite Module Enumerator&lt;/li&gt;&lt;li&gt;Module Status Service - A service that can be used to retrieve information about what modules are loaded&lt;/li&gt;&lt;li&gt;Extended Module Service - An extended module loader service with support to install modules on demand using windows installer&lt;/li&gt;&lt;li&gt;Visual Studio Templates&lt;/li&gt;&lt;li&gt;Composite WPF Extensions - Add-on commands, services, regions, etc to aid you in your Composite WPF development&lt;/li&gt;&lt;li&gt;Infragistics Extensions - Infragistics Extensions for CompositeWPF&lt;/li&gt;&lt;li&gt;Samples&lt;/li&gt;
&lt;/ul&gt;See the &lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Documentation&amp;amp;referringTitle=Home"&gt;Documentation&lt;/a&gt; index for information on how to use each of these extensions and components.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Contributing to Composite WPF Contrib
&lt;/h3&gt;Would you like to join as a developer of the Composite WPF Contrib project to share your own extensions or improve the existing codebase? Great! Here is what you need to know&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.codeplex.com/entlibcontrib/Wiki/View.aspx?title=About%20p%26p%20%22Contrib%22%20projects&amp;amp;referringTitle=Home" class="externalLink"&gt;About p&amp;amp;p &amp;quot;Contrib&amp;quot; projects&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Guidelines%20for%20Composite%20WPF%20Contrib%20code&amp;amp;referringTitle=Home"&gt;Guidelines for Composite WPF Contrib code&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Sign%20Up%20Process&amp;amp;referringTitle=Home"&gt;Sign Up Process&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;
Other p&amp;amp;p Contrib Projects
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="/scsfcontrib" class="externalLink"&gt;Smart Client Contrib&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="/wcsfcontrib" class="externalLink"&gt;Web Client Software Factory Contrib&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="/entlibcontrib" class="externalLink"&gt;Enterprise Library Contrib&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</description><author>ejadib</author><pubDate>Sat, 13 Sep 2008 20:36:38 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20080913083638P</guid></item><item><title>Updated Wiki: WPFQuickstartRegeneratedWithCAL</title><link>http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=WPFQuickstartRegeneratedWithCAL&amp;version=7</link><description>&lt;div class="wikidoc"&gt;
&lt;b&gt;&lt;a href="javascript:window.location.href='http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=43266';"&gt;Download pdf version of this document&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;h1&gt;
Regenerating the WPF/SC-SF Quickstart with the Composite Application Library
&lt;/h1&gt;The &lt;b&gt;Composite Application Guidance for WPF&lt;/b&gt; (Prism) is a set of assets for developing Composite WPF applications that addresses the challenges around building complex enterprise WPF applications. It is not a new version of &lt;b&gt;Composite UI Application Block&lt;/b&gt; (CAB) but the concepts of Modularity (composition), Services, Dependency Injection, and Event Brokering are also present in this new guidance because they are essential for building composite applications. However, their manifestations are very different than what you see in CAB.&lt;br /&gt;&lt;h2&gt;
Contents
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#Purpose"&gt;Purpose&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="#Prerequisites"&gt;Prerequisites&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="#Structure"&gt;Application Structure&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="#InitialSolution"&gt;Creating the initial solution&lt;/a&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#Shell"&gt;Preparing the Shell&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;&lt;a href="#Modules"&gt;Creating Modules&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="#Views"&gt;Creating Views&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="#Results"&gt;Checking the Results&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;h2&gt;
Purpose &lt;a name="Purpose"&gt;&lt;/a&gt;
&lt;/h2&gt;In this article, you will see how the WPF Quickstart shipped with the &lt;a href="http://msdn.microsoft.com/en-us/library/aa480482.aspx" class="externalLink"&gt;Smart Client Software Factory&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; was regenerated using the &lt;a href="http://msdn.microsoft.com/en-us/library/cc707819.aspx" class="externalLink"&gt;Composite Application Guidance for WPF&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. It includes guidance about how to create the initial solution from scratch, identify the regions, use the Event Aggregator service and load modules.&lt;br /&gt;&lt;h2&gt;
Prerequisites &lt;a name="Prerequisites"&gt;&lt;/a&gt;
&lt;/h2&gt;This topic requires you to have the following &lt;b&gt;Composite Application Library&lt;/b&gt; and &lt;b&gt;Unity Application Block&lt;/b&gt; assemblies:&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;Microsoft.Practices.Composite.dll&lt;/li&gt;&lt;li&gt;Microsoft.Practices.Composite.Wpf.dll&lt;/li&gt;&lt;li&gt;Microsoft.Practices.Composite.UnityExtensions.dll&lt;/li&gt;&lt;li&gt;Microsoft.Practices.Unity.dll&lt;/li&gt;&lt;li&gt;Microsoft.Practices.ObjectBuilder2.dll&lt;/li&gt;
&lt;/ul&gt;The &lt;b&gt;Composite Application Library&lt;/b&gt; ships as source code, which means you must compile it to get the Composite Application Library assemblies.&lt;br /&gt;&lt;h2&gt;
Application Structure &lt;a name="Structure"&gt;&lt;/a&gt;
&lt;/h2&gt;Both the &lt;b&gt;Composite Application Library&lt;/b&gt; and &lt;b&gt;Composite UI Application Block&lt;/b&gt; applications have similar solution structure with the following components:&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;An startup project that contains the shell view that defines the layout&lt;/li&gt;&lt;li&gt;Modules that add views, services, and other functionalities&lt;/li&gt;&lt;li&gt;&lt;b&gt;[Optionally]&lt;/b&gt; Infrastructure projects to share common artifacts and constants definitions.&lt;/li&gt;
&lt;/ul&gt;The following figure shows the equivalent elements between the original &lt;a href="http://msdn.microsoft.com/en-us/library/cc540814.aspx" class="externalLink"&gt;WPF Quickstart&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; shipped with the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=5C42C35D-DA1C-40B9-892E-11AB13AAFD9E&amp;amp;displaylang=en" class="externalLink"&gt;SCSF source code&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; and the WPF Quickstart rewritten to use the Composite Application Library.&lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=43203" alt="CABvsCAPPG.png" /&gt;&lt;br /&gt;&lt;b&gt;Figure 1&lt;/b&gt;&lt;br /&gt;&lt;i&gt;Solution structure&lt;/i&gt;&lt;br /&gt;&lt;h2&gt;
Creating the initial solution &lt;a name="InitialSolution"&gt;&lt;/a&gt;
&lt;/h2&gt;To be able to use the features of the Composite Application Library, you will need to create a pure WPF Application. To do this, follow these steps:&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;In Visual Studio, create a new WPF application named &lt;b&gt;WPFQuickstartwithCAL&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Add the &lt;b&gt;Common&lt;/b&gt; and &lt;b&gt;Modules&lt;/b&gt; solution folders to the &lt;b&gt;WPFQuickstartwithCAL&lt;/b&gt; solution.&lt;/li&gt;&lt;li&gt;Create a new Class Library project in the &lt;b&gt;Common&lt;/b&gt; solution folder called &lt;b&gt;WPFQuickstartwithCAL.Infrastructure&lt;/b&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;table&gt;
&lt;tr&gt;
&lt;td&gt; &lt;b&gt;Note&lt;/b&gt;: In this project you will place common components like constants and events definitions. This is just a good practice but it is not required. &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;ul&gt;
&lt;li&gt;Add the &lt;b&gt;Constants&lt;/b&gt; and &lt;b&gt;Events&lt;/b&gt; folders to the &lt;b&gt;WPFQuickstartwithCAL.Infrastructure&lt;/b&gt; project.&lt;/li&gt;&lt;li&gt;Add the &lt;b&gt;RegionNames&lt;/b&gt; class to the &lt;b&gt;Constants&lt;/b&gt; folder and put there the definition of the following constants:&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;
public const string RightRegion = &amp;quot;RightRegion&amp;quot;;
public const string LeftRegion = &amp;quot;LeftRegion&amp;quot;; 
&lt;/pre&gt; &lt;br /&gt;These constants are used to identify regions throughout the application. A region is a mechanism that allows you to expose to the application Windows Presentation Foundation controls as components that encapsulate a particular visual way of displaying views. Regions can be accessed in a decoupled way by their name and they support adding or removing views dynamically at run time&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;Add the &lt;b&gt;ShowEmployeeEvent&lt;/b&gt; class to the &lt;b&gt;Events&lt;/b&gt; folder with the following event definition:&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;
public class ShowEmployeeEvent : CompositeWpfEvent&amp;lt;int&amp;gt;
{
} 
&lt;/pre&gt; &lt;br /&gt;&lt;table&gt;
&lt;tr&gt;
&lt;td&gt; &lt;b&gt;Note&lt;/b&gt;: All the modules of the final solution have a reference to the &lt;b&gt;WPFQuickstartwithCAL.Infrastructure&lt;/b&gt; project. &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;h3&gt;
Preparing the Shell &lt;a name="Shell"&gt;&lt;/a&gt;
&lt;/h3&gt;The application starting point is a &lt;b&gt;WPF Application&lt;/b&gt; project which contains a &lt;b&gt;Shell&lt;/b&gt;, a &lt;b&gt;Bootstrapper&lt;/b&gt; class and a &lt;b&gt;App.xaml&lt;/b&gt; file. The following is a description of these artifacts:&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Shell&lt;/b&gt;: A Composite WPF application should contain a place to host different UI components that exposes a way for itself to be populated by others. The following is the &lt;b&gt;Shell&lt;/b&gt; used in this solution:&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=43207" alt="Shell.png" /&gt;&lt;br /&gt;&lt;b&gt;Figure 2&lt;/b&gt;&lt;br /&gt;&lt;i&gt;Application’s Shell&lt;/i&gt;&lt;br /&gt; &lt;br /&gt;The &lt;b&gt;cal:RegionManager.RegionName&lt;/b&gt; attribute added to the control is an attached property which indicates that a region has to be created and associated with the control when the view is being built. The value of this attribute is set with the name of the region defined in the &lt;b&gt;RegionNames&lt;/b&gt; class.&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Bootstrapper&lt;/b&gt; class: This class inherits from &lt;b&gt;UnityBootstrapper&lt;/b&gt; and is in charge of initializing the application. The Bootstrapper is responsible for:&lt;/li&gt;
&lt;/ul&gt;&lt;ol&gt;
&lt;ol&gt;
&lt;li&gt;Initialize the container (&lt;b&gt;UnityBootstrapper&lt;/b&gt; base class uses the &lt;b&gt;Unity&lt;/b&gt; container).&lt;/li&gt;&lt;li&gt;Register core services, like the &lt;b&gt;RegionManager&lt;/b&gt; (it is used to get regions) and the &lt;b&gt;EventAggregator&lt;/b&gt; (it is used to implement event brokering).&lt;/li&gt;&lt;li&gt;Register adapters for the region that the application uses.&lt;/li&gt;&lt;li&gt;Create and shows the shell.&lt;/li&gt;&lt;li&gt;Load the modules. &lt;/li&gt;
&lt;/ol&gt;
&lt;/ol&gt;&lt;table&gt;
&lt;tr&gt;
&lt;td&gt; &lt;b&gt;Note&lt;/b&gt;: The Composite Application Library allows you to choose the way that your modules are loaded (dynamically or statically). By using static module loading, like this sample, the code is simplified and improves the application startup performance. &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt; &lt;br /&gt;&lt;pre&gt;
internal class Bootstrapper : UnityBootstrapper
{
    protected override IModuleEnumerator GetModuleEnumerator()
    {
        return new StaticModuleEnumerator()
            .AddModule(typeof(EmployeeDataModule))
            .AddModule(typeof(OrganizationChartModule));
    }
 
    protected override DependencyObject CreateShell()
    {
        Shell shell = new Shell();
        shell.Show();
 
        return shell;
    }
} 
&lt;/pre&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;App.xaml&lt;/b&gt; file: The &lt;b&gt;OnStartup&lt;/b&gt; method of the &lt;b&gt;App&lt;/b&gt; class is overridden to create and initialize the &lt;b&gt;Bootstrapper&lt;/b&gt; class.&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;
protected override void OnStartup(StartupEventArgs e)
{
    base.OnStartup(e);
 
    Bootstrapper bootstrapper = new Bootstrapper();
    bootstrapper.Run();
} 
&lt;/pre&gt; &lt;br /&gt;&lt;h2&gt;
Creating Modules &lt;a name="Modules"&gt;&lt;/a&gt;
&lt;/h2&gt;A module is a class library project that must have a class witch implements the &lt;b&gt;IModule&lt;/b&gt; interface. This interface has a single method: the &lt;b&gt;Initialize&lt;/b&gt; method. In this method you should register services, views and presenters in the container. It is also where you should create views and add them to the Shell’s regions.&lt;br /&gt;The WPF Quickstart has the following modules:&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;WPFQuickstartwithCAL.EmployeeData&lt;/b&gt;: In this module are placed the view that shows information about an employee (which is shown in the &lt;b&gt;Right&lt;/b&gt; region of the Shell) and a service that retrieves data about employees. The following code shows the implementation of the &lt;b&gt;EmployeeDataModule&lt;/b&gt; class.&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;
public class EmployeeDataModule : IModule
{
    private IUnityContainer container;
    private IRegionManager regionManager;
 
    public EmployeeDataModule(IUnityContainer container, IRegionManager regionManager)
    {
        this.container = container;
        this.regionManager = regionManager;
    }
 
    public void Initialize()
    {
        this.RegisterViewsAndServices();
 
        EmployeePresenter presenter = this.container.Resolve&amp;lt;EmployeePresenter&amp;gt;();
 
        IRegion mainRegion = this.regionManager.Regions[RegionNames.RightRegion];
        mainRegion.Add(presenter.View);
    }
 
    protected void RegisterViewsAndServices()
    {
        this.container.RegisterType&amp;lt;IEmployeeView, EmployeeView&amp;gt;();
    }
} 
&lt;/pre&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;WPFQuickstartwithCAL.OrganizationChart&lt;/b&gt;: In this module are placed the view that shows the organization chart. The view is showed in the &lt;b&gt;Left&lt;/b&gt; region of the Shell. The following code shows the implementation of the &lt;b&gt;OrganizationChartModule&lt;/b&gt; class.&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;
public class OrganizationChartModule : IModule
{
    private IUnityContainer container;
    private IRegionManager regionManager;
 
    public OrganizationChartModule(IUnityContainer container, IRegionManager regionManager)
    {
        this.container = container;
        this.regionManager = regionManager;
    }
 
    public void Initialize()
    {
        this.RegisterViewsAndServices();
 
        OrgChartPresenter presenter = this.container.Resolve&amp;lt;OrgChartPresenter&amp;gt;();
 
        IRegion mainRegion = this.regionManager.Regions[RegionNames.LeftRegion];
        mainRegion.Add(presenter.View);
    }
 
    protected void RegisterViewsAndServices()
    {
        this.container.RegisterType&amp;lt;IOrgChartView, OrgChartView&amp;gt;();
    }
} 
&lt;/pre&gt; &lt;br /&gt;The Figure 3 shows the structure of the two modules in the solution explorer.&lt;br /&gt; &lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=43205" alt="modules.png" /&gt;&lt;br /&gt;&lt;b&gt;Figure 3&lt;/b&gt;&lt;br /&gt;&lt;i&gt;Modules structure&lt;/i&gt;&lt;br /&gt;&lt;h2&gt;
Creating Views &lt;a name="Views"&gt;&lt;/a&gt;
&lt;/h2&gt;All the views are &lt;b&gt;WPF User Controls&lt;/b&gt;. To implement the view logic this sample implements the Model-View-Presenter pattern.&lt;br /&gt;In the MVP implementation of &lt;b&gt;CAB/SC-SF&lt;/b&gt;, the presenter has a reference to the view interface and the view also has a reference to its presenter. But in the MVP implementation of a &lt;b&gt;Composite WPF&lt;/b&gt; application the view usually does not have a reference to its presenter. The communication between the view and its presenter is achieved by using .NET events.&lt;br /&gt;Another difference is that in &lt;b&gt;CAB/SC-SF&lt;/b&gt; you created the view and the presenter was injected on it. In a &lt;b&gt;Composite WPF&lt;/b&gt; application, the presenter usually drives all the interaction, so the presenters are created using the container (by the &lt;b&gt;Resolve&lt;/b&gt; method) and receives a view passed to its constructor as a parameter. The Dependency Injection container handles the injection.&lt;br /&gt;These are the views used in the WPF Quickstart:&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;EmployeeView&lt;/b&gt; (EmployeeData module): The following classes are required to complete the view logic:&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Employee&lt;/b&gt; class. This is the view model, it is similar to the one used in the original  WPF QuickStart but takes advantage of the C# 3.5 features.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;pre&gt;
public class Employee
{
    public int Id { set; get; }
    public string Name { set; get; }
    public string Position { set; get; }
    public int Age { set; get; }
    public DateTime EmployedOn { set; get; }
} 
&lt;/pre&gt; &lt;br /&gt;&lt;ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;IEmployeeView&lt;/b&gt; interface&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;pre&gt;
public interface IEmployeeView
{
    Employee Model { get; set; }
} 
&lt;/pre&gt; &lt;br /&gt;&lt;ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;EmployeePresenter&lt;/b&gt; class&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;pre&gt;
public class EmployeePresenter
{
    private EmployeeService _employeeService;
 
    public EmployeePresenter(IEmployeeView view, EmployeeService employeeService, IEventAggregator eventAggregator)
    {
        this.View = view;
        this._employeeService = employeeService;
 
        eventAggregator.GetEvent&amp;lt;ShowEmployeeEvent&amp;gt;()
           .Subscribe(SetSelectedEmployee, ThreadOption.UIThread, true);
    }
 
    public void SetSelectedEmployee(int index)
    {
        Employee employee = _employeeService.GetEmployee(index);
        View.Model = employee;
    }
 
    public IEmployeeView View { get; set; }
} 
&lt;/pre&gt; &lt;br /&gt;When the presenter is created, the container resolves its dependencies (the employee view, the employee service and the event aggregator). The presenter subscribes its &lt;b&gt;SetSelectedEmployee&lt;/b&gt; method as a callback for the &lt;b&gt;ShowEmployeeEvent&lt;/b&gt; event.&lt;br /&gt;&lt;ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;EmployeeView&lt;/b&gt; WPF User Control. The following code shows the code behind and the XAML file.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;pre&gt;
public partial class EmployeeView : UserControl, IEmployeeView
{
    public EmployeeView()
    {
        InitializeComponent();
    }
 
    public Employee Model
    {
        get { return this.DataContext as Employee; }
        set { this.DataContext = value; }
    }
} 
&lt;/pre&gt; &lt;br /&gt;&lt;pre&gt;
&amp;lt;UserControl x:Class=&amp;quot;EmployeeData.Views.EmployeeView&amp;quot;
    xmlns=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;
    xmlns:x=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;
    xmlns:local=&amp;quot;clr-namespace:EmployeeData&amp;quot;&amp;gt;
    &amp;lt;GroupBox Header=&amp;quot;Employee Information&amp;quot;&amp;gt;
        &amp;lt;Grid DataContext=&amp;quot;{Binding}&amp;quot;&amp;gt;
            &amp;lt;Grid.ColumnDefinitions&amp;gt;
                &amp;lt;ColumnDefinition&amp;gt;&amp;lt;/ColumnDefinition&amp;gt;
                &amp;lt;ColumnDefinition Width=&amp;quot;5&amp;quot;&amp;gt;&amp;lt;/ColumnDefinition&amp;gt;
            &amp;lt;/Grid.ColumnDefinitions&amp;gt;
            &amp;lt;Grid.RowDefinitions&amp;gt;
                &amp;lt;RowDefinition&amp;gt;&amp;lt;/RowDefinition&amp;gt;
                &amp;lt;RowDefinition&amp;gt;&amp;lt;/RowDefinition&amp;gt;
                &amp;lt;RowDefinition&amp;gt;&amp;lt;/RowDefinition&amp;gt;
                &amp;lt;RowDefinition&amp;gt;&amp;lt;/RowDefinition&amp;gt;
                &amp;lt;RowDefinition&amp;gt;&amp;lt;/RowDefinition&amp;gt;
                &amp;lt;RowDefinition&amp;gt;&amp;lt;/RowDefinition&amp;gt;
                &amp;lt;RowDefinition&amp;gt;&amp;lt;/RowDefinition&amp;gt;
                &amp;lt;RowDefinition&amp;gt;&amp;lt;/RowDefinition&amp;gt;
            &amp;lt;/Grid.RowDefinitions&amp;gt;
            &amp;lt;TextBlock Text=&amp;quot;Name:&amp;quot; Grid.Column=&amp;quot;0&amp;quot; Grid.Row=&amp;quot;0&amp;quot;&amp;gt;&amp;lt;/TextBlock&amp;gt;
            &amp;lt;TextBlock Text=&amp;quot;Position:&amp;quot; Grid.Column=&amp;quot;0&amp;quot; Grid.Row=&amp;quot;2&amp;quot;&amp;gt;&amp;lt;/TextBlock&amp;gt;
            &amp;lt;TextBlock Text=&amp;quot;Age:&amp;quot; Grid.Column=&amp;quot;0&amp;quot; Grid.Row=&amp;quot;4&amp;quot;&amp;gt;&amp;lt;/TextBlock&amp;gt;
            &amp;lt;TextBlock Text=&amp;quot;Employed On:&amp;quot; Grid.Column=&amp;quot;0&amp;quot; Grid.Row=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;/TextBlock&amp;gt;
 
            &amp;lt;TextBox Text=&amp;quot;{Binding Path=Name}&amp;quot; Grid.Column=&amp;quot;0&amp;quot; Grid.Row=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;/TextBox&amp;gt;
            &amp;lt;TextBox Text=&amp;quot;{Binding Path=Position}&amp;quot; Grid.Column=&amp;quot;0&amp;quot; Grid.Row=&amp;quot;3&amp;quot;&amp;gt;&amp;lt;/TextBox&amp;gt;
            &amp;lt;TextBox Text=&amp;quot;{Binding Path=Age}&amp;quot; Grid.Column=&amp;quot;0&amp;quot; Grid.Row=&amp;quot;5&amp;quot;&amp;gt;&amp;lt;/TextBox&amp;gt;
            &amp;lt;TextBox Text=&amp;quot;{Binding Path=EmployedOn}&amp;quot; Grid.Column=&amp;quot;0&amp;quot; Grid.Row=&amp;quot;7&amp;quot;&amp;gt;&amp;lt;/TextBox&amp;gt;
        &amp;lt;/Grid&amp;gt;
    &amp;lt;/GroupBox&amp;gt;
&amp;lt;/UserControl&amp;gt; 
&lt;/pre&gt; &lt;br /&gt;The Figure 4 shows the final design of the view.&lt;br /&gt; &lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=43204" alt="EmployeeView.png" /&gt;&lt;br /&gt;&lt;b&gt;Figure 4&lt;/b&gt;&lt;br /&gt;&lt;i&gt;OrgCharView view&lt;/i&gt;&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;OrgChartView&lt;/b&gt; (OrganizationChart module): The following classes are required to complete the view logic:&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;IOrgChartView&lt;/b&gt; interface: Exposes the &lt;b&gt;PositionSelected&lt;/b&gt; event to communicate the view with the presenter (since the view does not have a reference to its presenter).&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;pre&gt;
public interface IOrgChartView
{
    event EventHandler&amp;lt;DataEventArgs&amp;lt;XmlElement&amp;gt;&amp;gt; PositionSelected;
    XmlDocument Model { get; set; }
} 
&lt;/pre&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;OrgChartPresenter&lt;/b&gt; class: The presenter raises the &lt;b&gt;ShowEmployeeEvent&lt;/b&gt; event when a position is selected in the view.&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;
public class OrgChartPresenter
{
    private readonly IEventAggregator _eventAggregator;
 
    public OrgChartPresenter(IOrgChartView view, IEventAggregator eventAggregator)
    {
        this.View = view;
        this._eventAggregator = eventAggregator;
 
        this.View.PositionSelected += delegate(object sender, DataEventArgs&amp;lt;XmlElement&amp;gt; args)
          {
              if (_eventAggregator != null)
              {
                  int selectedEmployeeId = Int32.Parse(args.Value.Attributes[&amp;quot;ID&amp;quot;].Value, CultureInfo.InvariantCulture);
 
                  _eventAggregator.GetEvent&amp;lt;ShowEmployeeEvent&amp;gt;()
                                           .Publish(selectedEmployeeId);
              }
          };
 
        XmlDocument chart = new XmlDocument();
        chart.Load(@&amp;quot;OrganizationChart.xml&amp;quot;);
        View.Model = chart;
    }
 
    public IOrgChartView View { get; set; }
} 
&lt;/pre&gt; &lt;br /&gt;&lt;ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;OrgChartView&lt;/b&gt; WPF User Control. When a user selects a position in the chart, the view raises the &lt;b&gt;PositionSelected&lt;/b&gt; event. The following code shows the view&amp;#180;s code behind.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;table&gt;
&lt;tr&gt;
&lt;td&gt; &lt;b&gt;Note&lt;/b&gt;: The XAML code is not shown here for simplicity purposes. The code is the same as the one used in the original WPF Quickstart. &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt; &lt;br /&gt;&lt;pre&gt;
public partial class OrgChartView : UserControl, IOrgChartView
{
    public OrgChartView()
    {
        InitializeComponent();
    }
 
    public static readonly DependencyProperty OrgChartDataSourceProperty =
        DependencyProperty.Register(&amp;quot;OrgChartDataSource&amp;quot;, typeof(XmlDocument), typeof(OrgChartView), new FrameworkPropertyMetadata(null, new PropertyChangedCallback(OnValueChanged)));
 
    private static void OnValueChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
    {
        OrgChartView control = (OrgChartView)obj;
        XmlDataProvider provider = (XmlDataProvider)control.Resources[&amp;quot;xdpOrgChart&amp;quot;];
        provider.Document = (XmlDocument)args.NewValue;
    }
 
    void SelectionChanged(object sender, RoutedEventArgs e)
    {
        XmlElement element = ((XmlElement)((TreeView)e.Source).SelectedItem);
        PositionSelected(this, new DataEventArgs&amp;lt;XmlElement&amp;gt;(element));
    }
 
    public XmlDocument Model
    {
        get { return (XmlDocument)GetValue(OrgChartDataSourceProperty); }
        set { SetValue(OrgChartDataSourceProperty, value); }
    }
 
    public event EventHandler&amp;lt;DataEventArgs&amp;lt;XmlElement&amp;gt;&amp;gt; PositionSelected = delegate { };
} 
&lt;/pre&gt; &lt;br /&gt;The Figure 5 shows the final design of the view (copied from the &lt;b&gt;WPF Quickstart&lt;/b&gt; source code).&lt;br /&gt; &lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=43206" alt="OrgCharView.png" /&gt; &lt;br /&gt;&lt;b&gt;Figure 5&lt;/b&gt;&lt;br /&gt;&lt;i&gt;OrgCharView view&lt;/i&gt;&lt;br /&gt;&lt;h2&gt;
Checking the Results &lt;a name="Results"&gt;&lt;/a&gt;
&lt;/h2&gt;Build and run the final solution by pressing &lt;b&gt;F5&lt;/b&gt;. You will see both views from the &lt;b&gt;EmployeeView&lt;/b&gt; and &lt;b&gt;OrgChartView&lt;/b&gt; views loaded in the Shell:&lt;br /&gt; &lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=43208" alt="WPFQuickstart.png" /&gt;&lt;br /&gt;&lt;b&gt;Figure 6&lt;/b&gt;&lt;br /&gt;&lt;i&gt;Regenerated Quickstart running&lt;/i&gt;&lt;br /&gt; &lt;br /&gt;If you click in a different block in the organization chart of the left view, you will see the corresponding employee information populated in the right view. This is accomplished with the EventAggregator service and the ShowEmployeeEvent event.&lt;br /&gt;
&lt;/div&gt;</description><author>mconverti</author><pubDate>Mon, 08 Sep 2008 13:53:57 GMT</pubDate><guid isPermaLink="false">Updated Wiki: WPFQuickstartRegeneratedWithCAL 20080908015357P</guid></item><item><title>Updated Wiki: WPFQuickstartRegeneratedWithCAL</title><link>http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=WPFQuickstartRegeneratedWithCAL&amp;version=6</link><description>&lt;div class="wikidoc"&gt;
&lt;a href="javascript:window.location.href='http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=43266';"&gt;Download pdf version of this document&lt;/a&gt;&lt;br /&gt;&lt;h1&gt;
Regenerating the WPF/SC-SF Quickstart with the Composite Application Library
&lt;/h1&gt;The &lt;b&gt;Composite Application Guidance for WPF&lt;/b&gt; (Prism) is a set of assets for developing Composite WPF applications that addresses the challenges around building complex enterprise WPF applications. It is not a new version of &lt;b&gt;Composite UI Application Block&lt;/b&gt; (CAB) but the concepts of Modularity (composition), Services, Dependency Injection, and Event Brokering are also present in this new guidance because they are essential for building composite applications. However, their manifestations are very different than what you see in CAB.&lt;br /&gt;&lt;h2&gt;
Contents
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#Purpose"&gt;Purpose&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="#Prerequisites"&gt;Prerequisites&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="#Structure"&gt;Application Structure&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="#InitialSolution"&gt;Creating the initial solution&lt;/a&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#Shell"&gt;Preparing the Shell&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;&lt;a href="#Modules"&gt;Creating Modules&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="#Views"&gt;Creating Views&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="#Results"&gt;Checking the Results&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;h2&gt;
Purpose &lt;a name="Purpose"&gt;&lt;/a&gt;
&lt;/h2&gt;In this article, you will see how the WPF Quickstart shipped with the &lt;a href="http://msdn.microsoft.com/en-us/library/aa480482.aspx" class="externalLink"&gt;Smart Client Software Factory&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; was regenerated using the &lt;a href="http://msdn.microsoft.com/en-us/library/cc707819.aspx" class="externalLink"&gt;Composite Application Guidance for WPF&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. It includes guidance about how to create the initial solution from scratch, identify the regions, use the Event Aggregator service and load modules.&lt;br /&gt;&lt;h2&gt;
Prerequisites &lt;a name="Prerequisites"&gt;&lt;/a&gt;
&lt;/h2&gt;This topic requires you to have the following &lt;b&gt;Composite Application Library&lt;/b&gt; and &lt;b&gt;Unity Application Block&lt;/b&gt; assemblies:&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;Microsoft.Practices.Composite.dll&lt;/li&gt;&lt;li&gt;Microsoft.Practices.Composite.Wpf.dll&lt;/li&gt;&lt;li&gt;Microsoft.Practices.Composite.UnityExtensions.dll&lt;/li&gt;&lt;li&gt;Microsoft.Practices.Unity.dll&lt;/li&gt;&lt;li&gt;Microsoft.Practices.ObjectBuilder2.dll&lt;/li&gt;
&lt;/ul&gt;The &lt;b&gt;Composite Application Library&lt;/b&gt; ships as source code, which means you must compile it to get the Composite Application Library assemblies.&lt;br /&gt;&lt;h2&gt;
Application Structure &lt;a name="Structure"&gt;&lt;/a&gt;
&lt;/h2&gt;Both the &lt;b&gt;Composite Application Library&lt;/b&gt; and &lt;b&gt;Composite UI Application Block&lt;/b&gt; applications have similar solution structure with the following components:&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;An startup project that contains the shell view that defines the layout&lt;/li&gt;&lt;li&gt;Modules that add views, services, and other functionalities&lt;/li&gt;&lt;li&gt;&lt;b&gt;[Optionally]&lt;/b&gt; Infrastructure projects to share common artifacts and constants definitions.&lt;/li&gt;
&lt;/ul&gt;The following figure shows the equivalent elements between the original &lt;a href="http://msdn.microsoft.com/en-us/library/cc540814.aspx" class="externalLink"&gt;WPF Quickstart&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; shipped with the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=5C42C35D-DA1C-40B9-892E-11AB13AAFD9E&amp;amp;displaylang=en" class="externalLink"&gt;SCSF source code&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; and the WPF Quickstart rewritten to use the Composite Application Library.&lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=43203" alt="CABvsCAPPG.png" /&gt;&lt;br /&gt;&lt;b&gt;Figure 1&lt;/b&gt;&lt;br /&gt;&lt;i&gt;Solution structure&lt;/i&gt;&lt;br /&gt;&lt;h2&gt;
Creating the initial solution &lt;a name="InitialSolution"&gt;&lt;/a&gt;
&lt;/h2&gt;To be able to use the features of the Composite Application Library, you will need to create a pure WPF Application. To do this, follow these steps:&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;In Visual Studio, create a new WPF application named &lt;b&gt;WPFQuickstartwithCAL&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Add the &lt;b&gt;Common&lt;/b&gt; and &lt;b&gt;Modules&lt;/b&gt; solution folders to the &lt;b&gt;WPFQuickstartwithCAL&lt;/b&gt; solution.&lt;/li&gt;&lt;li&gt;Create a new Class Library project in the &lt;b&gt;Common&lt;/b&gt; solution folder called &lt;b&gt;WPFQuickstartwithCAL.Infrastructure&lt;/b&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;table&gt;
&lt;tr&gt;
&lt;td&gt; &lt;b&gt;Note&lt;/b&gt;: In this project you will place common components like constants and events definitions. This is just a good practice but it is not required. &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;ul&gt;
&lt;li&gt;Add the &lt;b&gt;Constants&lt;/b&gt; and &lt;b&gt;Events&lt;/b&gt; folders to the &lt;b&gt;WPFQuickstartwithCAL.Infrastructure&lt;/b&gt; project.&lt;/li&gt;&lt;li&gt;Add the &lt;b&gt;RegionNames&lt;/b&gt; class to the &lt;b&gt;Constants&lt;/b&gt; folder and put there the definition of the following constants:&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;
public const string RightRegion = &amp;quot;RightRegion&amp;quot;;
public const string LeftRegion = &amp;quot;LeftRegion&amp;quot;; 
&lt;/pre&gt; &lt;br /&gt;These constants are used to identify regions throughout the application. A region is a mechanism that allows you to expose to the application Windows Presentation Foundation controls as components that encapsulate a particular visual way of displaying views. Regions can be accessed in a decoupled way by their name and they support adding or removing views dynamically at run time&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;Add the &lt;b&gt;ShowEmployeeEvent&lt;/b&gt; class to the &lt;b&gt;Events&lt;/b&gt; folder with the following event definition:&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;
public class ShowEmployeeEvent : CompositeWpfEvent&amp;lt;int&amp;gt;
{
} 
&lt;/pre&gt; &lt;br /&gt;&lt;table&gt;
&lt;tr&gt;
&lt;td&gt; &lt;b&gt;Note&lt;/b&gt;: All the modules of the final solution have a reference to the &lt;b&gt;WPFQuickstartwithCAL.Infrastructure&lt;/b&gt; project. &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;h3&gt;
Preparing the Shell &lt;a name="Shell"&gt;&lt;/a&gt;
&lt;/h3&gt;The application starting point is a &lt;b&gt;WPF Application&lt;/b&gt; project which contains a &lt;b&gt;Shell&lt;/b&gt;, a &lt;b&gt;Bootstrapper&lt;/b&gt; class and a &lt;b&gt;App.xaml&lt;/b&gt; file. The following is a description of these artifacts:&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Shell&lt;/b&gt;: A Composite WPF application should contain a place to host different UI components that exposes a way for itself to be populated by others. The following is the &lt;b&gt;Shell&lt;/b&gt; used in this solution:&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=43207" alt="Shell.png" /&gt;&lt;br /&gt;&lt;b&gt;Figure 2&lt;/b&gt;&lt;br /&gt;&lt;i&gt;Application’s Shell&lt;/i&gt;&lt;br /&gt; &lt;br /&gt;The &lt;b&gt;cal:RegionManager.RegionName&lt;/b&gt; attribute added to the control is an attached property which indicates that a region has to be created and associated with the control when the view is being built. The value of this attribute is set with the name of the region defined in the &lt;b&gt;RegionNames&lt;/b&gt; class.&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Bootstrapper&lt;/b&gt; class: This class inherits from &lt;b&gt;UnityBootstrapper&lt;/b&gt; and is in charge of initializing the application. The Bootstrapper is responsible for:&lt;/li&gt;
&lt;/ul&gt;&lt;ol&gt;
&lt;ol&gt;
&lt;li&gt;Initialize the container (&lt;b&gt;UnityBootstrapper&lt;/b&gt; base class uses the &lt;b&gt;Unity&lt;/b&gt; container).&lt;/li&gt;&lt;li&gt;Register core services, like the &lt;b&gt;RegionManager&lt;/b&gt; (it is used to get regions) and the &lt;b&gt;EventAggregator&lt;/b&gt; (it is used to implement event brokering).&lt;/li&gt;&lt;li&gt;Register adapters for the region that the application uses.&lt;/li&gt;&lt;li&gt;Create and shows the shell.&lt;/li&gt;&lt;li&gt;Load the modules. &lt;/li&gt;
&lt;/ol&gt;
&lt;/ol&gt;&lt;table&gt;
&lt;tr&gt;
&lt;td&gt; &lt;b&gt;Note&lt;/b&gt;: The Composite Application Library allows you to choose the way that your modules are loaded (dynamically or statically). By using static module loading, like this sample, the code is simplified and improves the application startup performance. &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt; &lt;br /&gt;&lt;pre&gt;
internal class Bootstrapper : UnityBootstrapper
{
    protected override IModuleEnumerator GetModuleEnumerator()
    {
        return new StaticModuleEnumerator()
            .AddModule(typeof(EmployeeDataModule))
            .AddModule(typeof(OrganizationChartModule));
    }
 
    protected override DependencyObject CreateShell()
    {
        Shell shell = new Shell();
        shell.Show();
 
        return shell;
    }
} 
&lt;/pre&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;App.xaml&lt;/b&gt; file: The &lt;b&gt;OnStartup&lt;/b&gt; method of the &lt;b&gt;App&lt;/b&gt; class is overridden to create and initialize the &lt;b&gt;Bootstrapper&lt;/b&gt; class.&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;
protected override void OnStartup(StartupEventArgs e)
{
    base.OnStartup(e);
 
    Bootstrapper bootstrapper = new Bootstrapper();
    bootstrapper.Run();
} 
&lt;/pre&gt; &lt;br /&gt;&lt;h2&gt;
Creating Modules &lt;a name="Modules"&gt;&lt;/a&gt;
&lt;/h2&gt;A module is a class library project that must have a class witch implements the &lt;b&gt;IModule&lt;/b&gt; interface. This interface has a single method: the &lt;b&gt;Initialize&lt;/b&gt; method. In this method you should register services, views and presenters in the container. It is also where you should create views and add them to the Shell’s regions.&lt;br /&gt;The WPF Quickstart has the following modules:&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;WPFQuickstartwithCAL.EmployeeData&lt;/b&gt;: In this module are placed the view that shows information about an employee (which is shown in the &lt;b&gt;Right&lt;/b&gt; region of the Shell) and a service that retrieves data about employees. The following code shows the implementation of the &lt;b&gt;EmployeeDataModule&lt;/b&gt; class.&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;
public class EmployeeDataModule : IModule
{
    private IUnityContainer container;
    private IRegionManager regionManager;
 
    public EmployeeDataModule(IUnityContainer container, IRegionManager regionManager)
    {
        this.container = container;
        this.regionManager = regionManager;
    }
 
    public void Initialize()
    {
        this.RegisterViewsAndServices();
 
        EmployeePresenter presenter = this.container.Resolve&amp;lt;EmployeePresenter&amp;gt;();
 
        IRegion mainRegion = this.regionManager.Regions[RegionNames.RightRegion];
        mainRegion.Add(presenter.View);
    }
 
    protected void RegisterViewsAndServices()
    {
        this.container.RegisterType&amp;lt;IEmployeeView, EmployeeView&amp;gt;();
    }
} 
&lt;/pre&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;WPFQuickstartwithCAL.OrganizationChart&lt;/b&gt;: In this module are placed the view that shows the organization chart. The view is showed in the &lt;b&gt;Left&lt;/b&gt; region of the Shell. The following code shows the implementation of the &lt;b&gt;OrganizationChartModule&lt;/b&gt; class.&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;
public class OrganizationChartModule : IModule
{
    private IUnityContainer container;
    private IRegionManager regionManager;
 
    public OrganizationChartModule(IUnityContainer container, IRegionManager regionManager)
    {
        this.container = container;
        this.regionManager = regionManager;
    }
 
    public void Initialize()
    {
        this.RegisterViewsAndServices();
 
        OrgChartPresenter presenter = this.container.Resolve&amp;lt;OrgChartPresenter&amp;gt;();
 
        IRegion mainRegion = this.regionManager.Regions[RegionNames.LeftRegion];
        mainRegion.Add(presenter.View);
    }
 
    protected void RegisterViewsAndServices()
    {
        this.container.RegisterType&amp;lt;IOrgChartView, OrgChartView&amp;gt;();
    }
} 
&lt;/pre&gt; &lt;br /&gt;The Figure 3 shows the structure of the two modules in the solution explorer.&lt;br /&gt; &lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=43205" alt="modules.png" /&gt;&lt;br /&gt;&lt;b&gt;Figure 3&lt;/b&gt;&lt;br /&gt;&lt;i&gt;Modules structure&lt;/i&gt;&lt;br /&gt;&lt;h2&gt;
Creating Views &lt;a name="Views"&gt;&lt;/a&gt;
&lt;/h2&gt;All the views are &lt;b&gt;WPF User Controls&lt;/b&gt;. To implement the view logic this sample implements the Model-View-Presenter pattern.&lt;br /&gt;In the MVP implementation of &lt;b&gt;CAB/SC-SF&lt;/b&gt;, the presenter has a reference to the view interface and the view also has a reference to its presenter. But in the MVP implementation of a &lt;b&gt;Composite WPF&lt;/b&gt; application the view usually does not have a reference to its presenter. The communication between the view and its presenter is achieved by using .NET events.&lt;br /&gt;Another difference is that in &lt;b&gt;CAB/SC-SF&lt;/b&gt; you created the view and the presenter was injected on it. In a &lt;b&gt;Composite WPF&lt;/b&gt; application, the presenter usually drives all the interaction, so the presenters are created using the container (by the &lt;b&gt;Resolve&lt;/b&gt; method) and receives a view passed to its constructor as a parameter. The Dependency Injection container handles the injection.&lt;br /&gt;These are the views used in the WPF Quickstart:&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;EmployeeView&lt;/b&gt; (EmployeeData module): The following classes are required to complete the view logic:&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Employee&lt;/b&gt; class. This is the view model, it is similar to the one used in the original  WPF QuickStart but takes advantage of the C# 3.5 features.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;pre&gt;
public class Employee
{
    public int Id { set; get; }
    public string Name { set; get; }
    public string Position { set; get; }
    public int Age { set; get; }
    public DateTime EmployedOn { set; get; }
} 
&lt;/pre&gt; &lt;br /&gt;&lt;ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;IEmployeeView&lt;/b&gt; interface&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;pre&gt;
public interface IEmployeeView
{
    Employee Model { get; set; }
} 
&lt;/pre&gt; &lt;br /&gt;&lt;ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;EmployeePresenter&lt;/b&gt; class&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;pre&gt;
public class EmployeePresenter
{
    private EmployeeService _employeeService;
 
    public EmployeePresenter(IEmployeeView view, EmployeeService employeeService, IEventAggregator eventAggregator)
    {
        this.View = view;
        this._employeeService = employeeService;
 
        eventAggregator.GetEvent&amp;lt;ShowEmployeeEvent&amp;gt;()
           .Subscribe(SetSelectedEmployee, ThreadOption.UIThread, true);
    }
 
    public void SetSelectedEmployee(int index)
    {
        Employee employee = _employeeService.GetEmployee(index);
        View.Model = employee;
    }
 
    public IEmployeeView View { get; set; }
} 
&lt;/pre&gt; &lt;br /&gt;When the presenter is created, the container resolves its dependencies (the employee view, the employee service and the event aggregator). The presenter subscribes its &lt;b&gt;SetSelectedEmployee&lt;/b&gt; method as a callback for the &lt;b&gt;ShowEmployeeEvent&lt;/b&gt; event.&lt;br /&gt;&lt;ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;EmployeeView&lt;/b&gt; WPF User Control. The following code shows the code behind and the XAML file.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;pre&gt;
public partial class EmployeeView : UserControl, IEmployeeView
{
    public EmployeeView()
    {
        InitializeComponent();
    }
 
    public Employee Model
    {
        get { return this.DataContext as Employee; }
        set { this.DataContext = value; }
    }
} 
&lt;/pre&gt; &lt;br /&gt;&lt;pre&gt;
&amp;lt;UserControl x:Class=&amp;quot;EmployeeData.Views.EmployeeView&amp;quot;
    xmlns=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;
    xmlns:x=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;
    xmlns:local=&amp;quot;clr-namespace:EmployeeData&amp;quot;&amp;gt;
    &amp;lt;GroupBox Header=&amp;quot;Employee Information&amp;quot;&amp;gt;
        &amp;lt;Grid DataContext=&amp;quot;{Binding}&amp;quot;&amp;gt;
            &amp;lt;Grid.ColumnDefinitions&amp;gt;
                &amp;lt;ColumnDefinition&amp;gt;&amp;lt;/ColumnDefinition&amp;gt;
                &amp;lt;ColumnDefinition Width=&amp;quot;5&amp;quot;&amp;gt;&amp;lt;/ColumnDefinition&amp;gt;
            &amp;lt;/Grid.ColumnDefinitions&amp;gt;
            &amp;lt;Grid.RowDefinitions&amp;gt;
                &amp;lt;RowDefinition&amp;gt;&amp;lt;/RowDefinition&amp;gt;
                &amp;lt;RowDefinition&amp;gt;&amp;lt;/RowDefinition&amp;gt;
                &amp;lt;RowDefinition&amp;gt;&amp;lt;/RowDefinition&amp;gt;
                &amp;lt;RowDefinition&amp;gt;&amp;lt;/RowDefinition&amp;gt;
                &amp;lt;RowDefinition&amp;gt;&amp;lt;/RowDefinition&amp;gt;
                &amp;lt;RowDefinition&amp;gt;&amp;lt;/RowDefinition&amp;gt;
                &amp;lt;RowDefinition&amp;gt;&amp;lt;/RowDefinition&amp;gt;
                &amp;lt;RowDefinition&amp;gt;&amp;lt;/RowDefinition&amp;gt;
            &amp;lt;/Grid.RowDefinitions&amp;gt;
            &amp;lt;TextBlock Text=&amp;quot;Name:&amp;quot; Grid.Column=&amp;quot;0&amp;quot; Grid.Row=&amp;quot;0&amp;quot;&amp;gt;&amp;lt;/TextBlock&amp;gt;
            &amp;lt;TextBlock Text=&amp;quot;Position:&amp;quot; Grid.Column=&amp;quot;0&amp;quot; Grid.Row=&amp;quot;2&amp;quot;&amp;gt;&amp;lt;/TextBlock&amp;gt;
            &amp;lt;TextBlock Text=&amp;quot;Age:&amp;quot; Grid.Column=&amp;quot;0&amp;quot; Grid.Row=&amp;quot;4&amp;quot;&amp;gt;&amp;lt;/TextBlock&amp;gt;
            &amp;lt;TextBlock Text=&amp;quot;Employed On:&amp;quot; Grid.Column=&amp;quot;0&amp;quot; Grid.Row=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;/TextBlock&amp;gt;
 
            &amp;lt;TextBox Text=&amp;quot;{Binding Path=Name}&amp;quot; Grid.Column=&amp;quot;0&amp;quot; Grid.Row=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;/TextBox&amp;gt;
            &amp;lt;TextBox Text=&amp;quot;{Binding Path=Position}&amp;quot; Grid.Column=&amp;quot;0&amp;quot; Grid.Row=&amp;quot;3&amp;quot;&amp;gt;&amp;lt;/TextBox&amp;gt;
            &amp;lt;TextBox Text=&amp;quot;{Binding Path=Age}&amp;quot; Grid.Column=&amp;quot;0&amp;quot; Grid.Row=&amp;quot;5&amp;quot;&amp;gt;&amp;lt;/TextBox&amp;gt;
            &amp;lt;TextBox Text=&amp;quot;{Binding Path=EmployedOn}&amp;quot; Grid.Column=&amp;quot;0&amp;quot; Grid.Row=&amp;quot;7&amp;quot;&amp;gt;&amp;lt;/TextBox&amp;gt;
        &amp;lt;/Grid&amp;gt;
    &amp;lt;/GroupBox&amp;gt;
&amp;lt;/UserControl&amp;gt; 
&lt;/pre&gt; &lt;br /&gt;The Figure 4 shows the final design of the view.&lt;br /&gt; &lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=43204" alt="EmployeeView.png" /&gt;&lt;br /&gt;&lt;b&gt;Figure 4&lt;/b&gt;&lt;br /&gt;&lt;i&gt;OrgCharView view&lt;/i&gt;&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;OrgChartView&lt;/b&gt; (OrganizationChart module): The following classes are required to complete the view logic:&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;IOrgChartView&lt;/b&gt; interface: Exposes the &lt;b&gt;PositionSelected&lt;/b&gt; event to communicate the view with the presenter (since the view does not have a reference to its presenter).&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;pre&gt;
public interface IOrgChartView
{
    event EventHandler&amp;lt;DataEventArgs&amp;lt;XmlElement&amp;gt;&amp;gt; PositionSelected;
    XmlDocument Model { get; set; }
} 
&lt;/pre&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;OrgChartPresenter&lt;/b&gt; class: The presenter raises the &lt;b&gt;ShowEmployeeEvent&lt;/b&gt; event when a position is selected in the view.&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;
public class OrgChartPresenter
{
    private readonly IEventAggregator _eventAggregator;
 
    public OrgChartPresenter(IOrgChartView view, IEventAggregator eventAggregator)
    {
        this.View = view;
        this._eventAggregator = eventAggregator;
 
        this.View.PositionSelected += delegate(object sender, DataEventArgs&amp;lt;XmlElement&amp;gt; args)
          {
              if (_eventAggregator != null)
              {
                  int selectedEmployeeId = Int32.Parse(args.Value.Attributes[&amp;quot;ID&amp;quot;].Value, CultureInfo.InvariantCulture);
 
                  _eventAggregator.GetEvent&amp;lt;ShowEmployeeEvent&amp;gt;()
                                           .Publish(selectedEmployeeId);
              }
          };
 
        XmlDocument chart = new XmlDocument();
        chart.Load(@&amp;quot;OrganizationChart.xml&amp;quot;);
        View.Model = chart;
    }
 
    public IOrgChartView View { get; set; }
} 
&lt;/pre&gt; &lt;br /&gt;&lt;ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;OrgChartView&lt;/b&gt; WPF User Control. When a user selects a position in the chart, the view raises the &lt;b&gt;PositionSelected&lt;/b&gt; event. The following code shows the view&amp;#180;s code behind.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;table&gt;
&lt;tr&gt;
&lt;td&gt; &lt;b&gt;Note&lt;/b&gt;: The XAML code is not shown here for simplicity purposes. The code is the same as the one used in the original WPF Quickstart. &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt; &lt;br /&gt;&lt;pre&gt;
public partial class OrgChartView : UserControl, IOrgChartView
{
    public OrgChartView()
    {
        InitializeComponent();
    }
 
    public static readonly DependencyProperty OrgChartDataSourceProperty =
        DependencyProperty.Register(&amp;quot;OrgChartDataSource&amp;quot;, typeof(XmlDocument), typeof(OrgChartView), new FrameworkPropertyMetadata(null, new PropertyChangedCallback(OnValueChanged)));
 
    private static void OnValueChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
    {
        OrgChartView control = (OrgChartView)obj;
        XmlDataProvider provider = (XmlDataProvider)control.Resources[&amp;quot;xdpOrgChart&amp;quot;];
        provider.Document = (XmlDocument)args.NewValue;
    }
 
    void SelectionChanged(object sender, RoutedEventArgs e)
    {
        XmlElement element = ((XmlElement)((TreeView)e.Source).SelectedItem);
        PositionSelected(this, new DataEventArgs&amp;lt;XmlElement&amp;gt;(element));
    }
 
    public XmlDocument Model
    {
        get { return (XmlDocument)GetValue(OrgChartDataSourceProperty); }
        set { SetValue(OrgChartDataSourceProperty, value); }
    }
 
    public event EventHandler&amp;lt;DataEventArgs&amp;lt;XmlElement&amp;gt;&amp;gt; PositionSelected = delegate { };
} 
&lt;/pre&gt; &lt;br /&gt;The Figure 5 shows the final design of the view (copied from the &lt;b&gt;WPF Quickstart&lt;/b&gt; source code).&lt;br /&gt; &lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=43206" alt="OrgCharView.png" /&gt; &lt;br /&gt;&lt;b&gt;Figure 5&lt;/b&gt;&lt;br /&gt;&lt;i&gt;OrgCharView view&lt;/i&gt;&lt;br /&gt;&lt;h2&gt;
Checking the Results &lt;a name="Results"&gt;&lt;/a&gt;
&lt;/h2&gt;Build and run the final solution by pressing &lt;b&gt;F5&lt;/b&gt;. You will see both views from the &lt;b&gt;EmployeeView&lt;/b&gt; and &lt;b&gt;OrgChartView&lt;/b&gt; views loaded in the Shell:&lt;br /&gt; &lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=43208" alt="WPFQuickstart.png" /&gt;&lt;br /&gt;&lt;b&gt;Figure 6&lt;/b&gt;&lt;br /&gt;&lt;i&gt;Regenerated Quickstart running&lt;/i&gt;&lt;br /&gt; &lt;br /&gt;If you click in a different block in the organization chart of the left view, you will see the corresponding employee information populated in the right view. This is accomplished with the EventAggregator service and the ShowEmployeeEvent event.&lt;br /&gt;
&lt;/div&gt;</description><author>mconverti</author><pubDate>Mon, 08 Sep 2008 13:53:16 GMT</pubDate><guid isPermaLink="false">Updated Wiki: WPFQuickstartRegeneratedWithCAL 20080908015316P</guid></item><item><title>Updated Wiki: WPFQuickstartRegeneratedWithCAL</title><link>http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=WPFQuickstartRegeneratedWithCAL&amp;version=5</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;
Regenerating the WPF/SC-SF Quickstart with the Composite Application Library
&lt;/h1&gt;The &lt;b&gt;Composite Application Guidance for WPF&lt;/b&gt; (Prism) is a set of assets for developing Composite WPF applications that addresses the challenges around building complex enterprise WPF applications. It is not a new version of &lt;b&gt;Composite UI Application Block&lt;/b&gt; (CAB) but the concepts of Modularity (composition), Services, Dependency Injection, and Event Brokering are also present in this new guidance because they are essential for building composite applications. However, their manifestations are very different than what you see in CAB.&lt;br /&gt;&lt;h2&gt;
Contents
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#Purpose"&gt;Purpose&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="#Prerequisites"&gt;Prerequisites&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="#Structure"&gt;Application Structure&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="#InitialSolution"&gt;Creating the initial solution&lt;/a&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#Shell"&gt;Preparing the Shell&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;&lt;a href="#Modules"&gt;Creating Modules&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="#Views"&gt;Creating Views&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="#Results"&gt;Checking the Results&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;h2&gt;
Purpose &lt;a name="Purpose"&gt;&lt;/a&gt;
&lt;/h2&gt;In this article, you will see how the WPF Quickstart shipped with the &lt;a href="http://msdn.microsoft.com/en-us/library/aa480482.aspx" class="externalLink"&gt;Smart Client Software Factory&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; was regenerated using the &lt;a href="http://msdn.microsoft.com/en-us/library/cc707819.aspx" class="externalLink"&gt;Composite Application Guidance for WPF&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. It includes guidance about how to create the initial solution from scratch, identify the regions, use the Event Aggregator service and load modules.&lt;br /&gt;&lt;h2&gt;
Prerequisites &lt;a name="Prerequisites"&gt;&lt;/a&gt;
&lt;/h2&gt;This topic requires you to have the following &lt;b&gt;Composite Application Library&lt;/b&gt; and &lt;b&gt;Unity Application Block&lt;/b&gt; assemblies:&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;Microsoft.Practices.Composite.dll&lt;/li&gt;&lt;li&gt;Microsoft.Practices.Composite.Wpf.dll&lt;/li&gt;&lt;li&gt;Microsoft.Practices.Composite.UnityExtensions.dll&lt;/li&gt;&lt;li&gt;Microsoft.Practices.Unity.dll&lt;/li&gt;&lt;li&gt;Microsoft.Practices.ObjectBuilder2.dll&lt;/li&gt;
&lt;/ul&gt;The &lt;b&gt;Composite Application Library&lt;/b&gt; ships as source code, which means you must compile it to get the Composite Application Library assemblies.&lt;br /&gt;&lt;h2&gt;
Application Structure &lt;a name="Structure"&gt;&lt;/a&gt;
&lt;/h2&gt;Both the &lt;b&gt;Composite Application Library&lt;/b&gt; and &lt;b&gt;Composite UI Application Block&lt;/b&gt; applications have similar solution structure with the following components:&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;An startup project that contains the shell view that defines the layout&lt;/li&gt;&lt;li&gt;Modules that add views, services, and other functionalities&lt;/li&gt;&lt;li&gt;&lt;b&gt;[Optionally]&lt;/b&gt; Infrastructure projects to share common artifacts and constants definitions.&lt;/li&gt;
&lt;/ul&gt;The following figure shows the equivalent elements between the original &lt;a href="http://msdn.microsoft.com/en-us/library/cc540814.aspx" class="externalLink"&gt;WPF Quickstart&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; shipped with the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=5C42C35D-DA1C-40B9-892E-11AB13AAFD9E&amp;amp;displaylang=en" class="externalLink"&gt;SCSF source code&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; and the WPF Quickstart rewritten to use the Composite Application Library.&lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=43203" alt="CABvsCAPPG.png" /&gt;&lt;br /&gt;&lt;b&gt;Figure 1&lt;/b&gt;&lt;br /&gt;&lt;i&gt;Solution structure&lt;/i&gt;&lt;br /&gt;&lt;h2&gt;
Creating the initial solution &lt;a name="InitialSolution"&gt;&lt;/a&gt;
&lt;/h2&gt;To be able to use the features of the Composite Application Library, you will need to create a pure WPF Application. To do this, follow these steps:&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;In Visual Studio, create a new WPF application named &lt;b&gt;WPFQuickstartwithCAL&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Add the &lt;b&gt;Common&lt;/b&gt; and &lt;b&gt;Modules&lt;/b&gt; solution folders to the &lt;b&gt;WPFQuickstartwithCAL&lt;/b&gt; solution.&lt;/li&gt;&lt;li&gt;Create a new Class Library project in the &lt;b&gt;Common&lt;/b&gt; solution folder called &lt;b&gt;WPFQuickstartwithCAL.Infrastructure&lt;/b&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;table&gt;
&lt;tr&gt;
&lt;td&gt; &lt;b&gt;Note&lt;/b&gt;: In this project you will place common components like constants and events definitions. This is just a good practice but it is not required. &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;ul&gt;
&lt;li&gt;Add the &lt;b&gt;Constants&lt;/b&gt; and &lt;b&gt;Events&lt;/b&gt; folders to the &lt;b&gt;WPFQuickstartwithCAL.Infrastructure&lt;/b&gt; project.&lt;/li&gt;&lt;li&gt;Add the &lt;b&gt;RegionNames&lt;/b&gt; class to the &lt;b&gt;Constants&lt;/b&gt; folder and put there the definition of the following constants:&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;
public const string RightRegion = &amp;quot;RightRegion&amp;quot;;
public const string LeftRegion = &amp;quot;LeftRegion&amp;quot;; 
&lt;/pre&gt; &lt;br /&gt;These constants are used to identify regions throughout the application. A region is a mechanism that allows you to expose to the application Windows Presentation Foundation controls as components that encapsulate a particular visual way of displaying views. Regions can be accessed in a decoupled way by their name and they support adding or removing views dynamically at run time&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;Add the &lt;b&gt;ShowEmployeeEvent&lt;/b&gt; class to the &lt;b&gt;Events&lt;/b&gt; folder with the following event definition:&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;
public class ShowEmployeeEvent : CompositeWpfEvent&amp;lt;int&amp;gt;
{
} 
&lt;/pre&gt; &lt;br /&gt;&lt;table&gt;
&lt;tr&gt;
&lt;td&gt; &lt;b&gt;Note&lt;/b&gt;: All the modules of the final solution have a reference to the &lt;b&gt;WPFQuickstartwithCAL.Infrastructure&lt;/b&gt; project. &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;h3&gt;
Preparing the Shell &lt;a name="Shell"&gt;&lt;/a&gt;
&lt;/h3&gt;The application starting point is a &lt;b&gt;WPF Application&lt;/b&gt; project which contains a &lt;b&gt;Shell&lt;/b&gt;, a &lt;b&gt;Bootstrapper&lt;/b&gt; class and a &lt;b&gt;App.xaml&lt;/b&gt; file. The following is a description of these artifacts:&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Shell&lt;/b&gt;: A Composite WPF application should contain a place to host different UI components that exposes a way for itself to be populated by others. The following is the &lt;b&gt;Shell&lt;/b&gt; used in this solution:&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=43207" alt="Shell.png" /&gt;&lt;br /&gt;&lt;b&gt;Figure 2&lt;/b&gt;&lt;br /&gt;&lt;i&gt;Application’s Shell&lt;/i&gt;&lt;br /&gt; &lt;br /&gt;The &lt;b&gt;cal:RegionManager.RegionName&lt;/b&gt; attribute added to the control is an attached property which indicates that a region has to be created and associated with the control when the view is being built. The value of this attribute is set with the name of the region defined in the &lt;b&gt;RegionNames&lt;/b&gt; class.&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Bootstrapper&lt;/b&gt; class: This class inherits from &lt;b&gt;UnityBootstrapper&lt;/b&gt; and is in charge of initializing the application. The Bootstrapper is responsible for:&lt;/li&gt;
&lt;/ul&gt;&lt;ol&gt;
&lt;ol&gt;
&lt;li&gt;Initialize the container (&lt;b&gt;UnityBootstrapper&lt;/b&gt; base class uses the &lt;b&gt;Unity&lt;/b&gt; container).&lt;/li&gt;&lt;li&gt;Register core services, like the &lt;b&gt;RegionManager&lt;/b&gt; (it is used to get regions) and the &lt;b&gt;EventAggregator&lt;/b&gt; (it is used to implement event brokering).&lt;/li&gt;&lt;li&gt;Register adapters for the region that the application uses.&lt;/li&gt;&lt;li&gt;Create and shows the shell.&lt;/li&gt;&lt;li&gt;Load the modules. &lt;/li&gt;
&lt;/ol&gt;
&lt;/ol&gt;&lt;table&gt;
&lt;tr&gt;
&lt;td&gt; &lt;b&gt;Note&lt;/b&gt;: The Composite Application Library allows you to choose the way that your modules are loaded (dynamically or statically). By using static module loading, like this sample, the code is simplified and improves the application startup performance. &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt; &lt;br /&gt;&lt;pre&gt;
internal class Bootstrapper : UnityBootstrapper
{
    protected override IModuleEnumerator GetModuleEnumerator()
    {
        return new StaticModuleEnumerator()
            .AddModule(typeof(EmployeeDataModule))
            .AddModule(typeof(OrganizationChartModule));
    }
 
    protected override DependencyObject CreateShell()
    {
        Shell shell = new Shell();
        shell.Show();
 
        return shell;
    }
} 
&lt;/pre&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;App.xaml&lt;/b&gt; file: The &lt;b&gt;OnStartup&lt;/b&gt; method of the &lt;b&gt;App&lt;/b&gt; class is overridden to create and initialize the &lt;b&gt;Bootstrapper&lt;/b&gt; class.&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;
protected override void OnStartup(StartupEventArgs e)
{
    base.OnStartup(e);
 
    Bootstrapper bootstrapper = new Bootstrapper();
    bootstrapper.Run();
} 
&lt;/pre&gt; &lt;br /&gt;&lt;h2&gt;
Creating Modules &lt;a name="Modules"&gt;&lt;/a&gt;
&lt;/h2&gt;A module is a class library project that must have a class witch implements the &lt;b&gt;IModule&lt;/b&gt; interface. This interface has a single method: the &lt;b&gt;Initialize&lt;/b&gt; method. In this method you should register services, views and presenters in the container. It is also where you should create views and add them to the Shell’s regions.&lt;br /&gt;The WPF Quickstart has the following modules:&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;WPFQuickstartwithCAL.EmployeeData&lt;/b&gt;: In this module are placed the view that shows information about an employee (which is shown in the &lt;b&gt;Right&lt;/b&gt; region of the Shell) and a service that retrieves data about employees. The following code shows the implementation of the &lt;b&gt;EmployeeDataModule&lt;/b&gt; class.&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;
public class EmployeeDataModule : IModule
{
    private IUnityContainer container;
    private IRegionManager regionManager;
 
    public EmployeeDataModule(IUnityContainer container, IRegionManager regionManager)
    {
        this.container = container;
        this.regionManager = regionManager;
    }
 
    public void Initialize()
    {
        this.RegisterViewsAndServices();
 
        EmployeePresenter presenter = this.container.Resolve&amp;lt;EmployeePresenter&amp;gt;();
 
        IRegion mainRegion = this.regionManager.Regions[RegionNames.RightRegion];
        mainRegion.Add(presenter.View);
    }
 
    protected void RegisterViewsAndServices()
    {
        this.container.RegisterType&amp;lt;IEmployeeView, EmployeeView&amp;gt;();
    }
} 
&lt;/pre&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;WPFQuickstartwithCAL.OrganizationChart&lt;/b&gt;: In this module are placed the view that shows the organization chart. The view is showed in the &lt;b&gt;Left&lt;/b&gt; region of the Shell. The following code shows the implementation of the &lt;b&gt;OrganizationChartModule&lt;/b&gt; class.&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;
public class OrganizationChartModule : IModule
{
    private IUnityContainer container;
    private IRegionManager regionManager;
 
    public OrganizationChartModule(IUnityContainer container, IRegionManager regionManager)
    {
        this.container = container;
        this.regionManager = regionManager;
    }
 
    public void Initialize()
    {
        this.RegisterViewsAndServices();
 
        OrgChartPresenter presenter = this.container.Resolve&amp;lt;OrgChartPresenter&amp;gt;();
 
        IRegion mainRegion = this.regionManager.Regions[RegionNames.LeftRegion];
        mainRegion.Add(presenter.View);
    }
 
    protected void RegisterViewsAndServices()
    {
        this.container.RegisterType&amp;lt;IOrgChartView, OrgChartView&amp;gt;();
    }
} 
&lt;/pre&gt; &lt;br /&gt;The Figure 3 shows the structure of the two modules in the solution explorer.&lt;br /&gt; &lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=43205" alt="modules.png" /&gt;&lt;br /&gt;&lt;b&gt;Figure 3&lt;/b&gt;&lt;br /&gt;&lt;i&gt;Modules structure&lt;/i&gt;&lt;br /&gt;&lt;h2&gt;
Creating Views &lt;a name="Views"&gt;&lt;/a&gt;
&lt;/h2&gt;All the views are &lt;b&gt;WPF User Controls&lt;/b&gt;. To implement the view logic this sample implements the Model-View-Presenter pattern.&lt;br /&gt;In the MVP implementation of &lt;b&gt;CAB/SC-SF&lt;/b&gt;, the presenter has a reference to the view interface and the view also has a reference to its presenter. But in the MVP implementation of a &lt;b&gt;Composite WPF&lt;/b&gt; application the view usually does not have a reference to its presenter. The communication between the view and its presenter is achieved by using .NET events.&lt;br /&gt;Another difference is that in &lt;b&gt;CAB/SC-SF&lt;/b&gt; you created the view and the presenter was injected on it. In a &lt;b&gt;Composite WPF&lt;/b&gt; application, the presenter usually drives all the interaction, so the presenters are created using the container (by the &lt;b&gt;Resolve&lt;/b&gt; method) and receives a view passed to its constructor as a parameter. The Dependency Injection container handles the injection.&lt;br /&gt;These are the views used in the WPF Quickstart:&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;EmployeeView&lt;/b&gt; (EmployeeData module): The following classes are required to complete the view logic:&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Employee&lt;/b&gt; class. This is the view model, it is similar to the one used in the original  WPF QuickStart but takes advantage of the C# 3.5 features.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;pre&gt;
public class Employee
{
    public int Id { set; get; }
    public string Name { set; get; }
    public string Position { set; get; }
    public int Age { set; get; }
    public DateTime EmployedOn { set; get; }
} 
&lt;/pre&gt; &lt;br /&gt;&lt;ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;IEmployeeView&lt;/b&gt; interface&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;pre&gt;
public interface IEmployeeView
{
    Employee Model { get; set; }
} 
&lt;/pre&gt; &lt;br /&gt;&lt;ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;EmployeePresenter&lt;/b&gt; class&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;pre&gt;
public class EmployeePresenter
{
    private EmployeeService _employeeService;
 
    public EmployeePresenter(IEmployeeView view, EmployeeService employeeService, IEventAggregator eventAggregator)
    {
        this.View = view;
        this._employeeService = employeeService;
 
        eventAggregator.GetEvent&amp;lt;ShowEmployeeEvent&amp;gt;()
           .Subscribe(SetSelectedEmployee, ThreadOption.UIThread, true);
    }
 
    public void SetSelectedEmployee(int index)
    {
        Employee employee = _employeeService.GetEmployee(index);
        View.Model = employee;
    }
 
    public IEmployeeView View { get; set; }
} 
&lt;/pre&gt; &lt;br /&gt;When the presenter is created, the container resolves its dependencies (the employee view, the employee service and the event aggregator). The presenter subscribes its &lt;b&gt;SetSelectedEmployee&lt;/b&gt; method as a callback for the &lt;b&gt;ShowEmployeeEvent&lt;/b&gt; event.&lt;br /&gt;&lt;ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;EmployeeView&lt;/b&gt; WPF User Control. The following code shows the code behind and the XAML file.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;pre&gt;
public partial class EmployeeView : UserControl, IEmployeeView
{
    public EmployeeView()
    {
        InitializeComponent();
    }
 
    public Employee Model
    {
        get { return this.DataContext as Employee; }
        set { this.DataContext = value; }
    }
} 
&lt;/pre&gt; &lt;br /&gt;&lt;pre&gt;
&amp;lt;UserControl x:Class=&amp;quot;EmployeeData.Views.EmployeeView&amp;quot;
    xmlns=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;
    xmlns:x=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;
    xmlns:local=&amp;quot;clr-namespace:EmployeeData&amp;quot;&amp;gt;
    &amp;lt;GroupBox Header=&amp;quot;Employee Information&amp;quot;&amp;gt;
        &amp;lt;Grid DataContext=&amp;quot;{Binding}&amp;quot;&amp;gt;
            &amp;lt;Grid.ColumnDefinitions&amp;gt;
                &amp;lt;ColumnDefinition&amp;gt;&amp;lt;/ColumnDefinition&amp;gt;
                &amp;lt;ColumnDefinition Width=&amp;quot;5&amp;quot;&amp;gt;&amp;lt;/ColumnDefinition&amp;gt;
            &amp;lt;/Grid.ColumnDefinitions&amp;gt;
            &amp;lt;Grid.RowDefinitions&amp;gt;
                &amp;lt;RowDefinition&amp;gt;&amp;lt;/RowDefinition&amp;gt;
                &amp;lt;RowDefinition&amp;gt;&amp;lt;/RowDefinition&amp;gt;
                &amp;lt;RowDefinition&amp;gt;&amp;lt;/RowDefinition&amp;gt;
                &amp;lt;RowDefinition&amp;gt;&amp;lt;/RowDefinition&amp;gt;
                &amp;lt;RowDefinition&amp;gt;&amp;lt;/RowDefinition&amp;gt;
                &amp;lt;RowDefinition&amp;gt;&amp;lt;/RowDefinition&amp;gt;
                &amp;lt;RowDefinition&amp;gt;&amp;lt;/RowDefinition&amp;gt;
                &amp;lt;RowDefinition&amp;gt;&amp;lt;/RowDefinition&amp;gt;
            &amp;lt;/Grid.RowDefinitions&amp;gt;
            &amp;lt;TextBlock Text=&amp;quot;Name:&amp;quot; Grid.Column=&amp;quot;0&amp;quot; Grid.Row=&amp;quot;0&amp;quot;&amp;gt;&amp;lt;/TextBlock&amp;gt;
            &amp;lt;TextBlock Text=&amp;quot;Position:&amp;quot; Grid.Column=&amp;quot;0&amp;quot; Grid.Row=&amp;quot;2&amp;quot;&amp;gt;&amp;lt;/TextBlock&amp;gt;
            &amp;lt;TextBlock Text=&amp;quot;Age:&amp;quot; Grid.Column=&amp;quot;0&amp;quot; Grid.Row=&amp;quot;4&amp;quot;&amp;gt;&amp;lt;/TextBlock&amp;gt;
            &amp;lt;TextBlock Text=&amp;quot;Employed On:&amp;quot; Grid.Column=&amp;quot;0&amp;quot; Grid.Row=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;/TextBlock&amp;gt;
 
            &amp;lt;TextBox Text=&amp;quot;{Binding Path=Name}&amp;quot; Grid.Column=&amp;quot;0&amp;quot; Grid.Row=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;/TextBox&amp;gt;
            &amp;lt;TextBox Text=&amp;quot;{Binding Path=Position}&amp;quot; Grid.Column=&amp;quot;0&amp;quot; Grid.Row=&amp;quot;3&amp;quot;&amp;gt;&amp;lt;/TextBox&amp;gt;
            &amp;lt;TextBox Text=&amp;quot;{Binding Path=Age}&amp;quot; Grid.Column=&amp;quot;0&amp;quot; Grid.Row=&amp;quot;5&amp;quot;&amp;gt;&amp;lt;/TextBox&amp;gt;
            &amp;lt;TextBox Text=&amp;quot;{Binding Path=EmployedOn}&amp;quot; Grid.Column=&amp;quot;0&amp;quot; Grid.Row=&amp;quot;7&amp;quot;&amp;gt;&amp;lt;/TextBox&amp;gt;
        &amp;lt;/Grid&amp;gt;
    &amp;lt;/GroupBox&amp;gt;
&amp;lt;/UserControl&amp;gt; 
&lt;/pre&gt; &lt;br /&gt;The Figure 4 shows the final design of the view.&lt;br /&gt; &lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=43204" alt="EmployeeView.png" /&gt;&lt;br /&gt;&lt;b&gt;Figure 4&lt;/b&gt;&lt;br /&gt;&lt;i&gt;OrgCharView view&lt;/i&gt;&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;OrgChartView&lt;/b&gt; (OrganizationChart module): The following classes are required to complete the view logic:&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;IOrgChartView&lt;/b&gt; interface: Exposes the &lt;b&gt;PositionSelected&lt;/b&gt; event to communicate the view with the presenter (since the view does not have a reference to its presenter).&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;pre&gt;
public interface IOrgChartView
{
    event EventHandler&amp;lt;DataEventArgs&amp;lt;XmlElement&amp;gt;&amp;gt; PositionSelected;
    XmlDocument Model { get; set; }
} 
&lt;/pre&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;OrgChartPresenter&lt;/b&gt; class: The presenter raises the &lt;b&gt;ShowEmployeeEvent&lt;/b&gt; event when a position is selected in the view.&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;
public class OrgChartPresenter
{
    private readonly IEventAggregator _eventAggregator;
 
    public OrgChartPresenter(IOrgChartView view, IEventAggregator eventAggregator)
    {
        this.View = view;
        this._eventAggregator = eventAggregator;
 
        this.View.PositionSelected += delegate(object sender, DataEventArgs&amp;lt;XmlElement&amp;gt; args)
          {
              if (_eventAggregator != null)
              {
                  int selectedEmployeeId = Int32.Parse(args.Value.Attributes[&amp;quot;ID&amp;quot;].Value, CultureInfo.InvariantCulture);
 
                  _eventAggregator.GetEvent&amp;lt;ShowEmployeeEvent&amp;gt;()
                                           .Publish(selectedEmployeeId);
              }
          };
 
        XmlDocument chart = new XmlDocument();
        chart.Load(@&amp;quot;OrganizationChart.xml&amp;quot;);
        View.Model = chart;
    }
 
    public IOrgChartView View { get; set; }
} 
&lt;/pre&gt; &lt;br /&gt;&lt;ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;OrgChartView&lt;/b&gt; WPF User Control. When a user selects a position in the chart, the view raises the &lt;b&gt;PositionSelected&lt;/b&gt; event. The following code shows the view&amp;#180;s code behind.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;table&gt;
&lt;tr&gt;
&lt;td&gt; &lt;b&gt;Note&lt;/b&gt;: The XAML code is not shown here for simplicity purposes. The code is the same as the one used in the original WPF Quickstart. &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt; &lt;br /&gt;&lt;pre&gt;
public partial class OrgChartView : UserControl, IOrgChartView
{
    public OrgChartView()
    {
        InitializeComponent();
    }
 
    public static readonly DependencyProperty OrgChartDataSourceProperty =
        DependencyProperty.Register(&amp;quot;OrgChartDataSource&amp;quot;, typeof(XmlDocument), typeof(OrgChartView), new FrameworkPropertyMetadata(null, new PropertyChangedCallback(OnValueChanged)));
 
    private static void OnValueChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
    {
        OrgChartView control = (OrgChartView)obj;
        XmlDataProvider provider = (XmlDataProvider)control.Resources[&amp;quot;xdpOrgChart&amp;quot;];
        provider.Document = (XmlDocument)args.NewValue;
    }
 
    void SelectionChanged(object sender, RoutedEventArgs e)
    {
        XmlElement element = ((XmlElement)((TreeView)e.Source).SelectedItem);
        PositionSelected(this, new DataEventArgs&amp;lt;XmlElement&amp;gt;(element));
    }
 
    public XmlDocument Model
    {
        get { return (XmlDocument)GetValue(OrgChartDataSourceProperty); }
        set { SetValue(OrgChartDataSourceProperty, value); }
    }
 
    public event EventHandler&amp;lt;DataEventArgs&amp;lt;XmlElement&amp;gt;&amp;gt; PositionSelected = delegate { };
} 
&lt;/pre&gt; &lt;br /&gt;The Figure 5 shows the final design of the view (copied from the &lt;b&gt;WPF Quickstart&lt;/b&gt; source code).&lt;br /&gt; &lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=43206" alt="OrgCharView.png" /&gt; &lt;br /&gt;&lt;b&gt;Figure 5&lt;/b&gt;&lt;br /&gt;&lt;i&gt;OrgCharView view&lt;/i&gt;&lt;br /&gt;&lt;h2&gt;
Checking the Results &lt;a name="Results"&gt;&lt;/a&gt;
&lt;/h2&gt;Build and run the final solution by pressing &lt;b&gt;F5&lt;/b&gt;. You will see both views from the &lt;b&gt;EmployeeView&lt;/b&gt; and &lt;b&gt;OrgChartView&lt;/b&gt; views loaded in the Shell:&lt;br /&gt; &lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=43208" alt="WPFQuickstart.png" /&gt;&lt;br /&gt;&lt;b&gt;Figure 6&lt;/b&gt;&lt;br /&gt;&lt;i&gt;Regenerated Quickstart running&lt;/i&gt;&lt;br /&gt; &lt;br /&gt;If you click in a different block in the organization chart of the left view, you will see the corresponding employee information populated in the right view. This is accomplished with the EventAggregator service and the ShowEmployeeEvent event.&lt;br /&gt;
&lt;/div&gt;</description><author>mconverti</author><pubDate>Sun, 07 Sep 2008 21:53:32 GMT</pubDate><guid isPermaLink="false">Updated Wiki: WPFQuickstartRegeneratedWithCAL 20080907095332P</guid></item><item><title>Updated Wiki: Home</title><link>http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Home&amp;version=30</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;
Welcome to the Composite WPF Contrib project
&lt;/h1&gt; &lt;br /&gt;Composite WPF Contrib is a community-developed library of extensions to the patterns &amp;amp; practices &lt;a href="/CompositeWPF" class="externalLink"&gt;Composite WPF project&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. &lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;If you are building custom tools and extensions and want to share them then Composite WPF Contrib will get it out to the masses.&lt;/li&gt;&lt;li&gt;If you've got a great idea for new extensions Composite WPF contrib is the place to find developers ready, willing, and able to make it happen.&lt;/li&gt;&lt;li&gt;If you use Composite WPF within your org, then Composite WPF Contrib is the place to find tools and extensions to add to your arsenal.&lt;/li&gt;&lt;li&gt;If you want to connect with others who are pushing the bar on Prism development, then Prism Contrib is the place to be.&lt;/li&gt;
&lt;/ul&gt;Prism contrib is about &lt;b&gt;YOU&lt;/b&gt;. With &lt;b&gt;your&lt;/b&gt; help we can make it a vibrant resource for WPF Composite developers world-wide.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
News
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;(2008-09-07) &lt;b&gt;New Sample&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;WPF Quickstart&lt;/b&gt; shipped with the &lt;a href="http://msdn.microsoft.com/en-us/library/aa480482.aspx" class="externalLink"&gt;Smart Client Software Factory&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; regenerated using the &lt;a href="http://msdn.microsoft.com/en-us/library/cc707819.aspx" class="externalLink"&gt;Composite Application Guidance for WPF&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=43211" alt="RegeneratedWPFQuickstart.png" /&gt;&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;(2008-09-05) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;DialogWorkspace&lt;/b&gt; Show any view as a dialog in your application. Sample is included.&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;(2008-08-11) &lt;b&gt;New Sample&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Sample application&lt;/b&gt; that demonstrate how to use the Disconnected Service Agent Application Block with CompositeWPF&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=41210" alt="dsa.png" /&gt;&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;(2008-07-31) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;TabGroupPaneRegionAdapter&lt;/b&gt;. Infragistics TabGroupPane Region Adapter for CompositeWPF&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=40287" alt="TabGroupPaneRegionAdapterMedium.jpg" /&gt;&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;(2008-07-25) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;ExtendedModuleLoaderService&lt;/b&gt;. Extended module loader service with support to install modules on demand using windows installer&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;(2008-07-21) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;OutlookBar&lt;/b&gt;. OutlookBar control and region adapter for CompositeWPF&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=39481" alt="outlookbar.png" /&gt;&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;(2008-07-17) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Module Status Service&lt;/b&gt;. The Module Status Service can be used to retrieve information about what modules are loaded&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;(2008-07-11) &lt;b&gt;New Extensions&lt;/b&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;CompositeModuleEnumerator&lt;/b&gt;. The CompositeModuleEnumerator makes it possible to combine several module enumerator instances into one module enumerator.&lt;/li&gt;&lt;li&gt;&lt;b&gt;ToolBarPanelRegionAdapter&lt;/b&gt;. This adapter adapts control of type &lt;b&gt;System.Windows.Controls.Primitives.ToolBarPanel&lt;/b&gt; and derived classes.&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;(2008-07-08) &lt;b&gt;New Visual Studio Templates&lt;/b&gt;. The goal of these templates is to help users start with the &lt;a href="/CompositeWPF" class="externalLink"&gt;Composite WPF project&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. &lt;/li&gt;
&lt;/ul&gt; &lt;br /&gt;&lt;h3&gt;
What's in Prism Contrib?
&lt;/h3&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;PrismAG - Composite WPF for Silverlight &lt;/li&gt;&lt;li&gt;OutlookBar - OutlookBar control and region adapter for CompositeWPF &lt;/li&gt;&lt;li&gt;CompositeModuleEnumerator - Composite Module Enumerator&lt;/li&gt;&lt;li&gt;Module Status Service - A service that can be used to retrieve information about what modules are loaded&lt;/li&gt;&lt;li&gt;Extended Module Service - An extended module loader service with support to install modules on demand using windows installer&lt;/li&gt;&lt;li&gt;Visual Studio Templates&lt;/li&gt;&lt;li&gt;Composite WPF Extensions - Add-on commands, services, regions, etc to aid you in your Composite WPF development&lt;/li&gt;&lt;li&gt;Infragistics Extensions - Infragistics Extensions for CompositeWPF&lt;/li&gt;&lt;li&gt;Samples&lt;/li&gt;
&lt;/ul&gt;See the &lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Documentation&amp;amp;referringTitle=Home"&gt;Documentation&lt;/a&gt; index for information on how to use each of these extensions and components.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Contributing to Composite WPF Contrib
&lt;/h3&gt;Would you like to join as a developer of the Composite WPF Contrib project to share your own extensions or improve the existing codebase? Great! Here is what you need to know&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.codeplex.com/entlibcontrib/Wiki/View.aspx?title=About%20p%26p%20%22Contrib%22%20projects&amp;amp;referringTitle=Home" class="externalLink"&gt;About p&amp;amp;p &amp;quot;Contrib&amp;quot; projects&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Guidelines%20for%20Composite%20WPF%20Contrib%20code&amp;amp;referringTitle=Home"&gt;Guidelines for Composite WPF Contrib code&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Sign%20Up%20Process&amp;amp;referringTitle=Home"&gt;Sign Up Process&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;
Other p&amp;amp;p Contrib Projects
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="/scsfcontrib" class="externalLink"&gt;Smart Client Contrib&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="/wcsfcontrib" class="externalLink"&gt;Web Client Software Factory Contrib&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="/entlibcontrib" class="externalLink"&gt;Enterprise Library Contrib&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</description><author>mconverti</author><pubDate>Sun, 07 Sep 2008 21:49:50 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20080907094950P</guid></item><item><title>Updated Wiki: Documentation</title><link>http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Documentation&amp;version=7</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;
Documentation
&lt;/h1&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=PrismAG&amp;amp;referringTitle=Documentation"&gt;PrismAG&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=OutlookBar&amp;amp;referringTitle=Documentation"&gt;OutlookBar&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=CompositeModuleEnumerator&amp;amp;referringTitle=Documentation"&gt;Composite Module Enumerator&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Module%20Status%20Service&amp;amp;referringTitle=Documentation"&gt;Module Status Service&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Extended%20Module%20Service&amp;amp;referringTitle=Documentation"&gt;Extended Module Loader Service&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=VisualStudioTemplates&amp;amp;referringTitle=Documentation"&gt;Visual Studio Templates&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=InfragisticsExtensions&amp;amp;referringTitle=Documentation"&gt;Infragistics Extensions&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=DSASampleCompositeWPF&amp;amp;referringTitle=Documentation"&gt;DSA Sample with CompositeWPF&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=DialogWorkspace&amp;amp;referringTitle=Documentation"&gt;Dialog Workspace&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=WPFQuickstartRegeneratedWithCAL&amp;amp;referringTitle=Documentation"&gt;WPF Quickstart Regenerated with Composite Application Library&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</description><author>mconverti</author><pubDate>Sun, 07 Sep 2008 20:42:44 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Documentation 20080907084244P</guid></item><item><title>Updated Wiki: WPFQuickstartRegeneratedWithCAL</title><link>http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=WPFQuickstartRegeneratedWithCAL&amp;version=4</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;
Regenerating the WPF/SC-SF Quickstart with the Composite Application Library
&lt;/h1&gt;The &lt;b&gt;Composite Application Guidance for WPF&lt;/b&gt; (Prism) is a set of assets for developing Composite WPF applications that addresses the challenges around building complex enterprise WPF applications. It is not a new version of &lt;b&gt;Composite UI Application Block&lt;/b&gt; (CAB) but the concepts of Modularity (composition), Services, Dependency Injection, and Event Brokering are also present in this new guidance because they are essential for building composite applications. However, their manifestations are very different than what you see in CAB.&lt;br /&gt;&lt;h2&gt;
Contents
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#Purpose"&gt;Purpose&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="#Prerequisites"&gt;Prerequisites&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="#Structure"&gt;Application Structure&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="#InitialSolution"&gt;Creating the initial solution&lt;/a&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#Shell"&gt;Preparing the Shell&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;&lt;a href="#Modules"&gt;Creating Modules&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="#Views"&gt;Creating Views&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="#Results"&gt;Checking the Results&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;h2&gt;
Purpose &lt;a name="Purpose"&gt;&lt;/a&gt;
&lt;/h2&gt;In this article, you will see how the WPF Quickstart shipped with the &lt;a href="http://msdn.microsoft.com/en-us/library/aa480482.aspx" class="externalLink"&gt;Smart Client Software Factory&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; was regenerated using the &lt;a href="http://msdn.microsoft.com/en-us/library/cc707819.aspx" class="externalLink"&gt;Composite Application Guidance for WPF&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. It includes guidance about how to create the initial solution from scratch, identify the regions, use the Event Aggregator service and load modules.&lt;br /&gt;&lt;h2&gt;
Prerequisites &lt;a name="Prerequisites"&gt;&lt;/a&gt;
&lt;/h2&gt;This topic requires you to have the following &lt;b&gt;Composite Application Library&lt;/b&gt; and &lt;b&gt;Unity Application Block&lt;/b&gt; assemblies:&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;Microsoft.Practices.Composite.dll&lt;/li&gt;&lt;li&gt;Microsoft.Practices.Composite.Wpf.dll&lt;/li&gt;&lt;li&gt;Microsoft.Practices.Composite.UnityExtensions.dll&lt;/li&gt;&lt;li&gt;Microsoft.Practices.Unity.dll&lt;/li&gt;&lt;li&gt;Microsoft.Practices.ObjectBuilder2.dll&lt;/li&gt;
&lt;/ul&gt;The &lt;b&gt;Composite Application Library&lt;/b&gt; ships as source code, which means you must compile it to get the Composite Application Library assemblies.&lt;br /&gt;&lt;h2&gt;
Application Structure &lt;a name="Structure"&gt;&lt;/a&gt;
&lt;/h2&gt;Both the &lt;b&gt;Composite Application Library&lt;/b&gt; and &lt;b&gt;Composite UI Application Block&lt;/b&gt; applications have similar solution structure with the following components:&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;An startup project that contains the shell view that defines the layout&lt;/li&gt;&lt;li&gt;Modules that add views, services, and other functionalities&lt;/li&gt;&lt;li&gt;&lt;b&gt;[Optionally]&lt;/b&gt; Infrastructure projects to share common artifacts and constants definitions.&lt;/li&gt;
&lt;/ul&gt;The following figure shows the equivalent elements between the original &lt;a href="http://msdn.microsoft.com/en-us/library/cc540814.aspx" class="externalLink"&gt;WPF Quickstart&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; shipped with the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=5C42C35D-DA1C-40B9-892E-11AB13AAFD9E&amp;amp;displaylang=en" class="externalLink"&gt;SCSF source code&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; and the WPF Quickstart rewritten to use the Composite Application Library.&lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=43203" alt="CABvsCAPPG.png" /&gt;&lt;br /&gt;&lt;b&gt;Figure 1&lt;/b&gt;&lt;br /&gt;&lt;i&gt;Solution structure&lt;/i&gt;&lt;br /&gt;&lt;h2&gt;
Creating the initial solution &lt;a name="InitialSolution"&gt;&lt;/a&gt;
&lt;/h2&gt;To be able to use the features of the Composite Application Library, you will need to create a pure WPF Application. To do this, follow these steps:&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;In Visual Studio, create a new WPF application named &lt;b&gt;WPFQuickstartwithCAL&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Add the &lt;b&gt;Common&lt;/b&gt; and &lt;b&gt;Modules&lt;/b&gt; solution folders to the &lt;b&gt;WPFQuickstartwithCAL&lt;/b&gt; solution.&lt;/li&gt;&lt;li&gt;Create a new Class Library project in the &lt;b&gt;Common&lt;/b&gt; solution folder called &lt;b&gt;WPFQuickstartwithCAL.Infrastructure&lt;/b&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;table&gt;
&lt;tr&gt;
&lt;td&gt; &lt;b&gt;Note&lt;/b&gt;: In this project you will place common components like constants and events definitions. This is just a good practice but it is not required. &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;ul&gt;
&lt;li&gt;Add the &lt;b&gt;Constants&lt;/b&gt; and &lt;b&gt;Events&lt;/b&gt; folders to the &lt;b&gt;WPFQuickstartwithCAL.Infrastructure&lt;/b&gt; project.&lt;/li&gt;&lt;li&gt;Add the &lt;b&gt;RegionNames&lt;/b&gt; class to the &lt;b&gt;Constants&lt;/b&gt; folder and put there the definition of the following constants:&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;
public const string RightRegion = &amp;quot;RightRegion&amp;quot;;
public const string LeftRegion = &amp;quot;LeftRegion&amp;quot;; 
&lt;/pre&gt; &lt;br /&gt;These constants are used to identify regions throughout the application. A region is a mechanism that allows you to expose to the application Windows Presentation Foundation controls as components that encapsulate a particular visual way of displaying views. Regions can be accessed in a decoupled way by their name and they support adding or removing views dynamically at run time&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;Add the &lt;b&gt;ShowEmployeeEvent&lt;/b&gt; class to the &lt;b&gt;Events&lt;/b&gt; folder with the following event definition:&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;
public class ShowEmployeeEvent : CompositeWpfEvent&amp;lt;int&amp;gt;
{
} 
&lt;/pre&gt; &lt;br /&gt;&lt;table&gt;
&lt;tr&gt;
&lt;td&gt; &lt;b&gt;Note&lt;/b&gt;: All the modules of the final solution have a reference to the &lt;b&gt;WPFQuickstartwithCAL.Infrastructure&lt;/b&gt; project. &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;h3&gt;
Preparing the Shell &lt;a name="Shell"&gt;&lt;/a&gt;
&lt;/h3&gt;The application starting point is a &lt;b&gt;WPF Application&lt;/b&gt; project which contains a &lt;b&gt;Shell&lt;/b&gt;, a &lt;b&gt;Bootstrapper&lt;/b&gt; class and a &lt;b&gt;App.xaml&lt;/b&gt; file. The following is a description of these artifacts:&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Shell&lt;/b&gt;: A Composite WPF application should contain a place to host different UI components that exposes a way for itself to be populated by others. The following is the &lt;b&gt;Shell&lt;/b&gt; used in this solution:&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=43207" alt="Shell.png" /&gt;&lt;br /&gt;&lt;b&gt;Figure 2&lt;/b&gt;&lt;br /&gt;&lt;i&gt;Application’s Shell&lt;/i&gt;&lt;br /&gt; &lt;br /&gt;The &lt;b&gt;cal:RegionManager.RegionName&lt;/b&gt; attribute added to the control is an attached property which indicates that a region has to be created and associated with the control when the view is being built. The value of this attribute is set with the name of the region defined in the &lt;b&gt;RegionNames&lt;/b&gt; class.&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Bootstrapper&lt;/b&gt; class: This class inherits from &lt;b&gt;UnityBootstrapper&lt;/b&gt; and is in charge of initializing the application. The Bootstrapper is responsible for:&lt;/li&gt;
&lt;/ul&gt;&lt;ol&gt;
&lt;ol&gt;
&lt;li&gt;Initialize the container (&lt;b&gt;UnityBootstrapper&lt;/b&gt; base class uses the &lt;b&gt;Unity&lt;/b&gt; container).&lt;/li&gt;&lt;li&gt;Register core services, like the &lt;b&gt;RegionManager&lt;/b&gt; (it is used to get regions) and the &lt;b&gt;EventAggregator&lt;/b&gt; (it is used to implement event brokering).&lt;/li&gt;&lt;li&gt;Register adapters for the region that the application uses.&lt;/li&gt;&lt;li&gt;Create and shows the shell.&lt;/li&gt;&lt;li&gt;Load the modules. &lt;/li&gt;
&lt;/ol&gt;
&lt;/ol&gt;&lt;table&gt;
&lt;tr&gt;
&lt;td&gt; &lt;b&gt;Note&lt;/b&gt;: The Composite Application Library allows you to choose the way that your modules are loaded (dynamically or statically). By using static module loading, like this sample, the code is simplified and improves the application startup performance. &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt; &lt;br /&gt;&lt;pre&gt;
internal class Bootstrapper : UnityBootstrapper
{
    protected override IModuleEnumerator GetModuleEnumerator()
    {
        return new StaticModuleEnumerator()
            .AddModule(typeof(EmployeeDataModule))
            .AddModule(typeof(OrganizationChartModule));
    }
 
    protected override DependencyObject CreateShell()
    {
        Shell shell = new Shell();
        shell.Show();
 
        return shell;
    }
} 
&lt;/pre&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;App.xaml&lt;/b&gt; file: The &lt;b&gt;OnStartup&lt;/b&gt; method of the &lt;b&gt;App&lt;/b&gt; class is overridden to create and initialize the &lt;b&gt;Bootstrapper&lt;/b&gt; class.&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;
protected override void OnStartup(StartupEventArgs e)
{
    base.OnStartup(e);
 
    Bootstrapper bootstrapper = new Bootstrapper();
    bootstrapper.Run();
} 
&lt;/pre&gt; &lt;br /&gt;&lt;h2&gt;
Creating Modules &lt;a name="Modules"&gt;&lt;/a&gt;
&lt;/h2&gt;A module is a class library project that must have a class witch implements the &lt;b&gt;IModule&lt;/b&gt; interface. This interface has a single method: the &lt;b&gt;Initialize&lt;/b&gt; method. In this method you should register services, views and presenters in the container. It is also where you should create views and add them to the Shell’s regions.&lt;br /&gt;The WPF Quickstart has the following modules:&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;WPFQuickstartwithCAL.EmployeeData&lt;/b&gt;: In this module are placed the view that shows information about an employee (which is shown in the &lt;b&gt;Right&lt;/b&gt; region of the Shell) and a service that retrieves data about employees. The following code shows the implementation of the &lt;b&gt;EmployeeDataModule&lt;/b&gt; class.&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;
public class EmployeeDataModule : IModule
{
    private IUnityContainer container;
    private IRegionManager regionManager;
 
    public EmployeeDataModule(IUnityContainer container, IRegionManager regionManager)
    {
        this.container = container;
        this.regionManager = regionManager;
    }
 
    public void Initialize()
    {
        this.RegisterViewsAndServices();
 
        EmployeePresenter presenter = this.container.Resolve&amp;lt;EmployeePresenter&amp;gt;();
 
        IRegion mainRegion = this.regionManager.Regions[RegionNames.RightRegion];
        mainRegion.Add(presenter.View);
    }
 
    protected void RegisterViewsAndServices()
    {
        this.container.RegisterType&amp;lt;IEmployeeView, EmployeeView&amp;gt;();
    }
} 
&lt;/pre&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;WPFQuickstartwithCAL.OrganizationChart&lt;/b&gt;: In this module are placed the view that shows the organization chart. The view is showed in the &lt;b&gt;Left&lt;/b&gt; region of the Shell. The following code shows the implementation of the &lt;b&gt;OrganizationChartModule&lt;/b&gt; class.&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;
public class OrganizationChartModule : IModule
{
    private IUnityContainer container;
    private IRegionManager regionManager;
 
    public OrganizationChartModule(IUnityContainer container, IRegionManager regionManager)
    {
        this.container = container;
        this.regionManager = regionManager;
    }
 
    public void Initialize()
    {
        this.RegisterViewsAndServices();
 
        OrgChartPresenter presenter = this.container.Resolve&amp;lt;OrgChartPresenter&amp;gt;();
 
        IRegion mainRegion = this.regionManager.Regions[RegionNames.LeftRegion];
        mainRegion.Add(presenter.View);
    }
 
    protected void RegisterViewsAndServices()
    {
        this.container.RegisterType&amp;lt;IOrgChartView, OrgChartView&amp;gt;();
    }
} 
&lt;/pre&gt; &lt;br /&gt;The Figure 3 shows the structure of the two modules in the solution explorer.&lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=43205" alt="modules.png" /&gt;&lt;br /&gt;&lt;b&gt;Figure 3&lt;/b&gt;&lt;br /&gt;&lt;i&gt;Modules structure&lt;/i&gt;&lt;br /&gt;&lt;h2&gt;
Creating Views &lt;a name="Views"&gt;&lt;/a&gt;
&lt;/h2&gt;All the views are &lt;b&gt;WPF User Controls&lt;/b&gt;. To implement the view logic this sample implements the Model-View-Presenter pattern.&lt;br /&gt;In the MVP implementation of &lt;b&gt;CAB/SC-SF&lt;/b&gt;, the presenter has a reference to the view interface and the view also has a reference to its presenter. But in the MVP implementation of a &lt;b&gt;Composite WPF&lt;/b&gt; application the view usually does not have a reference to its presenter. The communication between the view and its presenter is achieved by using .NET events.&lt;br /&gt;Another difference is that in &lt;b&gt;CAB/SC-SF&lt;/b&gt; you created the view and the presenter was injected on it. In a &lt;b&gt;Composite WPF&lt;/b&gt; application, the presenter usually drives all the interaction, so the presenters are created using the container (by the &lt;b&gt;Resolve&lt;/b&gt; method) and receives a view passed to its constructor as a parameter. The Dependency Injection container handles the injection.&lt;br /&gt;These are the views used in the WPF Quickstart:&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;EmployeeView&lt;/b&gt; (EmployeeData module): The following classes are required to complete the view logic:&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Employee&lt;/b&gt; class. This is the view model, it is similar to the one used in the original  WPF QuickStart but takes advantage of the C# 3.5 features.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;pre&gt;
public class Employee
{
    public int Id { set; get; }
    public string Name { set; get; }
    public string Position { set; get; }
    public int Age { set; get; }
    public DateTime EmployedOn { set; get; }
} 
&lt;/pre&gt; &lt;br /&gt;&lt;ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;IEmployeeView&lt;/b&gt; interface&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;pre&gt;
public interface IEmployeeView
{
    Employee Model { get; set; }
} 
&lt;/pre&gt; &lt;br /&gt;&lt;ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;EmployeePresenter&lt;/b&gt; class&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;pre&gt;
public class EmployeePresenter
{
    private EmployeeService _employeeService;
 
    public EmployeePresenter(IEmployeeView view, EmployeeService employeeService, IEventAggregator eventAggregator)
    {
        this.View = view;
        this._employeeService = employeeService;
 
        eventAggregator.GetEvent&amp;lt;ShowEmployeeEvent&amp;gt;()
           .Subscribe(SetSelectedEmployee, ThreadOption.UIThread, true);
    }
 
    public void SetSelectedEmployee(int index)
    {
        Employee employee = _employeeService.GetEmployee(index);
        View.Model = employee;
    }
 
    public IEmployeeView View { get; set; }
} 
&lt;/pre&gt; &lt;br /&gt;When the presenter is created, the container resolves its dependencies (the employee view, the employee service and the event aggregator). The presenter subscribes its &lt;b&gt;SetSelectedEmployee&lt;/b&gt; method as a callback for the &lt;b&gt;ShowEmployeeEvent&lt;/b&gt; event.&lt;br /&gt;&lt;ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;EmployeeView&lt;/b&gt; WPF User Control. The following code shows the code behind and the XAML file.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;pre&gt;
public partial class EmployeeView : UserControl, IEmployeeView
{
    public EmployeeView()
    {
        InitializeComponent();
    }
 
    public Employee Model
    {
        get { return this.DataContext as Employee; }
        set { this.DataContext = value; }
    }
} 
&lt;/pre&gt; &lt;br /&gt;&lt;pre&gt;
&amp;lt;UserControl x:Class=&amp;quot;EmployeeData.Views.EmployeeView&amp;quot;
    xmlns=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;
    xmlns:x=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;
    xmlns:local=&amp;quot;clr-namespace:EmployeeData&amp;quot;&amp;gt;
    &amp;lt;GroupBox Header=&amp;quot;Employee Information&amp;quot;&amp;gt;
        &amp;lt;Grid DataContext=&amp;quot;{Binding}&amp;quot;&amp;gt;
            &amp;lt;Grid.ColumnDefinitions&amp;gt;
                &amp;lt;ColumnDefinition&amp;gt;&amp;lt;/ColumnDefinition&amp;gt;
                &amp;lt;ColumnDefinition Width=&amp;quot;5&amp;quot;&amp;gt;&amp;lt;/ColumnDefinition&amp;gt;
            &amp;lt;/Grid.ColumnDefinitions&amp;gt;
            &amp;lt;Grid.RowDefinitions&amp;gt;
                &amp;lt;RowDefinition&amp;gt;&amp;lt;/RowDefinition&amp;gt;
                &amp;lt;RowDefinition&amp;gt;&amp;lt;/RowDefinition&amp;gt;
                &amp;lt;RowDefinition&amp;gt;&amp;lt;/RowDefinition&amp;gt;
                &amp;lt;RowDefinition&amp;gt;&amp;lt;/RowDefinition&amp;gt;
                &amp;lt;RowDefinition&amp;gt;&amp;lt;/RowDefinition&amp;gt;
                &amp;lt;RowDefinition&amp;gt;&amp;lt;/RowDefinition&amp;gt;
                &amp;lt;RowDefinition&amp;gt;&amp;lt;/RowDefinition&amp;gt;
                &amp;lt;RowDefinition&amp;gt;&amp;lt;/RowDefinition&amp;gt;
            &amp;lt;/Grid.RowDefinitions&amp;gt;
            &amp;lt;TextBlock Text=&amp;quot;Name:&amp;quot; Grid.Column=&amp;quot;0&amp;quot; Grid.Row=&amp;quot;0&amp;quot;&amp;gt;&amp;lt;/TextBlock&amp;gt;
            &amp;lt;TextBlock Text=&amp;quot;Position:&amp;quot; Grid.Column=&amp;quot;0&amp;quot; Grid.Row=&amp;quot;2&amp;quot;&amp;gt;&amp;lt;/TextBlock&amp;gt;
            &amp;lt;TextBlock Text=&amp;quot;Age:&amp;quot; Grid.Column=&amp;quot;0&amp;quot; Grid.Row=&amp;quot;4&amp;quot;&amp;gt;&amp;lt;/TextBlock&amp;gt;
            &amp;lt;TextBlock Text=&amp;quot;Employed On:&amp;quot; Grid.Column=&amp;quot;0&amp;quot; Grid.Row=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;/TextBlock&amp;gt;
 
            &amp;lt;TextBox Text=&amp;quot;{Binding Path=Name}&amp;quot; Grid.Column=&amp;quot;0&amp;quot; Grid.Row=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;/TextBox&amp;gt;
            &amp;lt;TextBox Text=&amp;quot;{Binding Path=Position}&amp;quot; Grid.Column=&amp;quot;0&amp;quot; Grid.Row=&amp;quot;3&amp;quot;&amp;gt;&amp;lt;/TextBox&amp;gt;
            &amp;lt;TextBox Text=&amp;quot;{Binding Path=Age}&amp;quot; Grid.Column=&amp;quot;0&amp;quot; Grid.Row=&amp;quot;5&amp;quot;&amp;gt;&amp;lt;/TextBox&amp;gt;
            &amp;lt;TextBox Text=&amp;quot;{Binding Path=EmployedOn}&amp;quot; Grid.Column=&amp;quot;0&amp;quot; Grid.Row=&amp;quot;7&amp;quot;&amp;gt;&amp;lt;/TextBox&amp;gt;
        &amp;lt;/Grid&amp;gt;
    &amp;lt;/GroupBox&amp;gt;
&amp;lt;/UserControl&amp;gt; 
&lt;/pre&gt; &lt;br /&gt;The Figure 4 shows the final design of the view.&lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=43204" alt="EmployeeView.png" /&gt;&lt;br /&gt;&lt;b&gt;Figure 4&lt;/b&gt;&lt;br /&gt;&lt;i&gt;OrgCharView view&lt;/i&gt;&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;OrgChartView&lt;/b&gt; (OrganizationChart module): The following classes are required to complete the view logic:&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;IOrgChartView&lt;/b&gt; interface: Exposes the &lt;b&gt;PositionSelected&lt;/b&gt; event to communicate the view with the presenter (since the view does not have a reference to its presenter).&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;pre&gt;
public interface IOrgChartView
{
    event EventHandler&amp;lt;DataEventArgs&amp;lt;XmlElement&amp;gt;&amp;gt; PositionSelected;
    XmlDocument Model { get; set; }
} 
&lt;/pre&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;OrgChartPresenter&lt;/b&gt; class: The presenter raises the &lt;b&gt;ShowEmployeeEvent&lt;/b&gt; event when a position is selected in the view.&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;
public class OrgChartPresenter
{
    private readonly IEventAggregator _eventAggregator;
 
    public OrgChartPresenter(IOrgChartView view, IEventAggregator eventAggregator)
    {
        this.View = view;
        this._eventAggregator = eventAggregator;
 
        this.View.PositionSelected += delegate(object sender, DataEventArgs&amp;lt;XmlElement&amp;gt; args)
          {
              if (_eventAggregator != null)
              {
                  int selectedEmployeeId = Int32.Parse(args.Value.Attributes[&amp;quot;ID&amp;quot;].Value, CultureInfo.InvariantCulture);
 
                  _eventAggregator.GetEvent&amp;lt;ShowEmployeeEvent&amp;gt;()
                                           .Publish(selectedEmployeeId);
              }
          };
 
        XmlDocument chart = new XmlDocument();
        chart.Load(@&amp;quot;OrganizationChart.xml&amp;quot;);
        View.Model = chart;
    }
 
    public IOrgChartView View { get; set; }
} 
&lt;/pre&gt; &lt;br /&gt;&lt;ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;OrgChartView&lt;/b&gt; WPF User Control. When a user selects a position in the chart, the view raises the &lt;b&gt;PositionSelected&lt;/b&gt; event. The following code shows the view&amp;#180;s code behind.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;table&gt;
&lt;tr&gt;
&lt;td&gt; &lt;b&gt;Note&lt;/b&gt;: The XAML code is not shown here for simplicity purposes. The code is the same as the one used in the original WPF Quickstart. &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt; &lt;br /&gt;&lt;pre&gt;
public partial class OrgChartView : UserControl, IOrgChartView
{
    public OrgChartView()
    {
        InitializeComponent();
    }
 
    public static readonly DependencyProperty OrgChartDataSourceProperty =
        DependencyProperty.Register(&amp;quot;OrgChartDataSource&amp;quot;, typeof(XmlDocument), typeof(OrgChartView), new FrameworkPropertyMetadata(null, new PropertyChangedCallback(OnValueChanged)));
 
    private static void OnValueChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
    {
        OrgChartView control = (OrgChartView)obj;
        XmlDataProvider provider = (XmlDataProvider)control.Resources[&amp;quot;xdpOrgChart&amp;quot;];
        provider.Document = (XmlDocument)args.NewValue;
    }
 
    void SelectionChanged(object sender, RoutedEventArgs e)
    {
        XmlElement element = ((XmlElement)((TreeView)e.Source).SelectedItem);
        PositionSelected(this, new DataEventArgs&amp;lt;XmlElement&amp;gt;(element));
    }
 
    public XmlDocument Model
    {
        get { return (XmlDocument)GetValue(OrgChartDataSourceProperty); }
        set { SetValue(OrgChartDataSourceProperty, value); }
    }
 
    public event EventHandler&amp;lt;DataEventArgs&amp;lt;XmlElement&amp;gt;&amp;gt; PositionSelected = delegate { };
} 
&lt;/pre&gt; &lt;br /&gt;The Figure 5 shows the final design of the view (copied from the &lt;b&gt;WPF Quickstart&lt;/b&gt; source code).&lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=43206" alt="OrgCharView.png" /&gt; &lt;br /&gt;&lt;b&gt;Figure 5&lt;/b&gt;&lt;br /&gt;&lt;i&gt;OrgCharView view&lt;/i&gt;&lt;br /&gt;&lt;h2&gt;
Checking the Results &lt;a name="Results"&gt;&lt;/a&gt;
&lt;/h2&gt;Build and run the final solution by pressing &lt;b&gt;F5&lt;/b&gt;. You will see both views from the &lt;b&gt;EmployeeView&lt;/b&gt; and &lt;b&gt;OrgChartView&lt;/b&gt; views loaded in the Shell:&lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=43208" alt="WPFQuickstart.png" /&gt;&lt;br /&gt;&lt;b&gt;Figure 6&lt;/b&gt;&lt;br /&gt;&lt;i&gt;Regenerated Quickstart running&lt;/i&gt;&lt;br /&gt;If you click in a different block in the organization chart of the left view, you will see the corresponding employee information populated in the right view. This is accomplished with the EventAggregator service and the ShowEmployeeEvent event.&lt;br /&gt;
&lt;/div&gt;</description><author>mconverti</author><pubDate>Sun, 07 Sep 2008 20:40:34 GMT</pubDate><guid isPermaLink="false">Updated Wiki: WPFQuickstartRegeneratedWithCAL 20080907084034P</guid></item><item><title>Updated Wiki: WPFQuickstartRegeneratedWithCAL</title><link>http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=WPFQuickstartRegeneratedWithCAL&amp;version=3</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;
Regenerating the WPF/SC-SF Quickstart with the Composite Application Library
&lt;/h1&gt;The &lt;b&gt;Composite Application Guidance for WPF&lt;/b&gt; (Prism) is a set of assets for developing Composite WPF applications that addresses the challenges around building complex enterprise WPF applications. It is not a new version of &lt;b&gt;Composite UI Application Block&lt;/b&gt; (CAB) but the concepts of Modularity (composition), Services, Dependency Injection, and Event Brokering are also present in this new guidance because they are essential for building composite applications. However, their manifestations are very different than what you see in CAB.&lt;br /&gt;&lt;h2&gt;
Contents
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#Purpose"&gt;Purpose&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="#Prerequisites"&gt;Prerequisites&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="#Structure"&gt;Application Structure&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="#InitialSolution"&gt;Creating the initial solution&lt;/a&gt;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#Shell"&gt;Preparing the Shell&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;&lt;a href="#Modules"&gt;Creating Modules&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CompositeWPFContrib/Wiki/View.aspx?title=Views&amp;amp;referringTitle=WPFQuickstartRegeneratedWithCAL"&gt;Creating Views&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="#Results"&gt;Checking the Results&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;h2&gt;
Purpose &lt;a name="Purpose"&gt;&lt;/a&gt;
&lt;/h2&gt;In this article, you will see how the WPF Quickstart shipped with the &lt;a href="http://msdn.microsoft.com/en-us/library/aa480482.aspx" class="externalLink"&gt;Smart Client Software Factory&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; was regenerated using the &lt;a href="http://msdn.microsoft.com/en-us/library/cc707819.aspx" class="externalLink"&gt;Composite Application Guidance for WPF&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. It includes guidance about how to create the initial solution from scratch, identify the regions, use the Event Aggregator service and load modules.&lt;br /&gt;&lt;h2&gt;
Prerequisites &lt;a name="Prerequisites"&gt;&lt;/a&gt;
&lt;/h2&gt;This topic requires you to have the following &lt;b&gt;Composite Application Library&lt;/b&gt; and &lt;b&gt;Unity Application Block&lt;/b&gt; assemblies:&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;Microsoft.Practices.Composite.dll&lt;/li&gt;&lt;li&gt;Microsoft.Practices.Composite.Wpf.dll&lt;/li&gt;&lt;li&gt;Microsoft.Practices.Composite.UnityExtensions.dll&lt;/li&gt;&lt;li&gt;Microsoft.Practices.Unity.dll&lt;/li&gt;&lt;li&gt;Microsoft.Practices.ObjectBuilder2.dll&lt;/li&gt;
&lt;/ul&gt;The &lt;b&gt;Composite Application Library&lt;/b&gt; ships as source code, which means you must compile it to get the Composite Application Library assemblies.&lt;br /&gt;&lt;h2&gt;
Application Structure &lt;a name="Structure"&gt;&lt;/a&gt;
&lt;/h2&gt;Both the &lt;b&gt;Composite Application Library&lt;/b&gt; and &lt;b&gt;Composite UI Application Block&lt;/b&gt; applications have similar solution structure with the following components:&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;An startup project that contains the shell view that defines the layout&lt;/li&gt;&lt;li&gt;Modules that add views, services, and other functionalities&lt;/li&gt;&lt;li&gt;&lt;b&gt;[Optionally]&lt;/b&gt; Infrastructure projects to share common artifacts and constants definitions.&lt;/li&gt;
&lt;/ul&gt;The following figure shows the equivalent elements between the original &lt;a href="http://msdn.microsoft.com/en-us/library/cc540814.aspx" class="externalLink"&gt;WPF Quickstart&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; shipped with the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=5C42C35D-DA1C-40B9-892E-11AB13AAFD9E&amp;amp;displaylang=en" class="externalLink"&gt;SCSF source code&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; and the WPF Quickstart rewritten to use the Composite Application Library.&lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=43203" alt="CABvsCAPPG.png" /&gt;&lt;br /&gt;&lt;b&gt;Figure 1&lt;/b&gt;&lt;br /&gt;&lt;i&gt;Solution structure&lt;/i&gt;&lt;br /&gt;&lt;h2&gt;
Creating the initial solution &lt;a name="InitialSolution"&gt;&lt;/a&gt;
&lt;/h2&gt;To be able to use the features of the Composite Application Library, you will need to create a pure WPF Application. To do this, follow these steps:&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;In Visual Studio, create a new WPF application named &lt;b&gt;WPFQuickstartwithCAL&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Add the &lt;b&gt;Common&lt;/b&gt; and &lt;b&gt;Modules&lt;/b&gt; solution folders to the &lt;b&gt;WPFQuickstartwithCAL&lt;/b&gt; solution.&lt;/li&gt;&lt;li&gt;Create a new Class Library project in the &lt;b&gt;Common&lt;/b&gt; solution folder called &lt;b&gt;WPFQuickstartwithCAL.Infrastructure&lt;/b&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;table&gt;
&lt;tr&gt;
&lt;td&gt; &lt;b&gt;Note&lt;/b&gt;: In this project you will place common components like constants and events definitions. This is just a good practice but it is not required. &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;ul&gt;
&lt;li&gt;Add the &lt;b&gt;Constants&lt;/b&gt; and &lt;b&gt;Events&lt;/b&gt; folders to the &lt;b&gt;WPFQuickstartwithCAL.Infrastructure&lt;/b&gt; project.&lt;/li&gt;&lt;li&gt;Add the &lt;b&gt;RegionNames&lt;/b&gt; class to the &lt;b&gt;Constants&lt;/b&gt; folder and put there the definition of the following constants:&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;
public const string RightRegion = &amp;quot;RightRegion&amp;quot;;
public const string LeftRegion = &amp;quot;LeftRegion&amp;quot;; 
&lt;/pre&gt; &lt;br /&gt;These constants are used to identify regions throughout the application. A region is a mechanism that allows you to expose to the application Windows Presentation Foundation controls as components that encapsulate a particular visual way of displaying views. Regions can be accessed in a decoupled way by their name and they support adding or removing views dynamically at run time&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;Add the &lt;b&gt;ShowEmployeeEvent&lt;/b&gt; class to the &lt;b&gt;Events&lt;/b&gt; folder with the following event definition:&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;
public class ShowEmployeeEvent : CompositeWpfEvent&amp;lt;int&amp;gt;
{
} 
&lt;/pre&gt; &lt;br /&gt;&lt;table&gt;
&lt;tr&gt;
&lt;td&gt; &lt;b&gt;Note&lt;/b&gt;: All the modules of the final solution have a reference to the &lt;b&gt;WPFQuickstartwithCAL.Infrastructure&lt;/b&gt; project. &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;h3&gt;
Preparing the Shell &lt;a name="Shell"&gt;&lt;/a&gt;
&lt;/h3&gt;The application starting point is a &lt;b&gt;WPF Application&lt;/b&gt; project which contains a &lt;b&gt;Shell&lt;/b&gt;, a &lt;b&gt;Bootstrapper&lt;/b&gt; class and a &lt;b&gt;App.xaml&lt;/b&gt; file. The following is a description of these artifacts:&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Shell&lt;/b&gt;: A Composite WPF application should contain a place to host different UI components that exposes a way for itself to be populated by others. The following is the &lt;b&gt;Shell&lt;/b&gt; used in this solution:&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=43207" alt="Shell.png" /&gt;&lt;br /&gt;&lt;b&gt;Figure 2&lt;/b&gt;&lt;br /&gt;&lt;i&gt;Application’s Shell&lt;/i&gt;&lt;br /&gt; &lt;br /&gt;The &lt;b&gt;cal:RegionManager.RegionName&lt;/b&gt; attribute added to the control is an attached property which indicates that a region has to be created and associated with the control when the view is being built. The value of this attribute is set with the name of the region defined in the &lt;b&gt;RegionNames&lt;/b&gt; class.&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Bootstrapper&lt;/b&gt; class: This class inherits from &lt;b&gt;UnityBootstrapper&lt;/b&gt; and is in charge of initializing the application. The Bootstrapper is responsible for:&lt;/li&gt;
&lt;/ul&gt;&lt;ol&gt;
&lt;ol&gt;
&lt;li&gt;Initialize the container (&lt;b&gt;UnityBootstrapper&lt;/b&gt; base class uses the &lt;b&gt;Unity&lt;/b&gt; container).&lt;/li&gt;&lt;li&gt;Register core services, like the &lt;b&gt;RegionManager&lt;/b&gt; (it is used to get regions) and the &lt;b&gt;EventAggregator&lt;/b&gt; (it is used to implement event brokering).&lt;/li&gt;&lt;li&gt;Register adapters for the region that the application uses.&lt;/li&gt;&lt;li&gt;Create and shows the shell.&lt;/li&gt;&lt;li&gt;Load the modules. &lt;/li&gt;
&lt;/ol&gt;
&lt;/ol&gt;&lt;table&gt;
&lt;tr&gt;
&lt;td&gt; &lt;b&gt;Note&lt;/b&gt;: The Composite Application Library allows you to choose the way that your modules are loaded (dynamically or statically). By using static module loading, like this sample, the code is simplified and improves the application startup performance. &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt; &lt;br /&gt;&lt;pre&gt;
internal class Bootstrapper : UnityBootstrapper
{
    protected override IModuleEnumerator GetModuleEnumerator()
    {
        return new StaticModuleEnumerator()
            .AddModule(typeof(EmployeeDataModule))
            .AddModule(typeof(OrganizationChartModule));
    }
 
    protected override DependencyObject CreateShell()
    {
        Shell shell = new Shell();
        shell.Show();
 
        return shell;
    }
} 
&lt;/pre&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;App.xaml&lt;/b&gt; file: The &lt;b&gt;OnStartup&lt;/b&gt; method of the &lt;b&gt;App&lt;/b&gt; class is overridden to create and initialize the &lt;b&gt;Bootstrapper&lt;/b&gt; class.&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;
protected override void OnStartup(StartupEventArgs e)
{
    base.OnStartup(e);
 
    Bootstrapper bootstrapper = new Bootstrapper();
    bootstrapper.Run();
} 
&lt;/pre&gt; &lt;br /&gt;&lt;h2&gt;
Creating Modules &lt;a name="Modules"&gt;&lt;/a&gt;
&lt;/h2&gt;A module is a class library project that must have a class witch implements the &lt;b&gt;IModule&lt;/b&gt; interface. This interface has a single method: the &lt;b&gt;Initialize&lt;/b&gt; method. In this method you should register services, views and presenters in the container. It is also where you should create views and add them to the Shell’s regions.&lt;br /&gt;The WPF Quickstart has the following modules:&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;WPFQuickstartwithCAL.EmployeeData&lt;/b&gt;: In this module are placed the view that shows information about an employee (which is shown in the &lt;b&gt;Right&lt;/b&gt; region of the Shell) and a service that retrieves data about employees. The following code shows the implementation of the &lt;b&gt;EmployeeDataModule&lt;/b&gt; class.&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;
public class EmployeeDataModule : IModule
{
    private IUnityContainer container;
    private IRegionManager regionManager;
 
    public EmployeeDataModule(IUnityContainer container, IRegionManager regionManager)
    {
        this.container = container;
        this.regionManager = regionManager;
    }
 
    public void Initialize()
    {
        this.RegisterViewsAndServices();
 
        EmployeePresenter presenter = this.container.Resolve&amp;lt;EmployeePresenter&amp;gt;();
 
        IRegion mainRegion = this.regionManager.Regions[RegionNames.RightRegion];
        mainRegion.Add(presenter.View);
    }
 
    protected void RegisterViewsAndServices()
    {
        this.container.RegisterType&amp;lt;IEmployeeView, EmployeeView&amp;gt;();
    }
} 
&lt;/pre&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;WPFQuickstartwithCAL.OrganizationChart&lt;/b&gt;: In this module are placed the view that shows the organization chart. The view is showed in the &lt;b&gt;Left&lt;/b&gt; region of the Shell. The following code shows the implementation of the &lt;b&gt;OrganizationChartModule&lt;/b&gt; class.&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;
public class OrganizationChartModule : IModule
{
    private IUnityContainer container;
    private IRegionManager regionManager;
 
    public OrganizationChartModule(IUnityContainer container, IRegionManager regionManager)
    {
        this.container = container;
        this.regionManager = regionManager;
    }
 
    public void Initialize()
    {
        this.RegisterViewsAndServices();
 
        OrgChartPresenter presenter = this.container.Resolve&amp;lt;OrgChartPresenter&amp;gt;();
 
        IRegion mainRegion = this.regionManager.Regions[RegionNames.LeftRegion];
        mainRegion.Add(presenter.View);
    }
 
    protected void RegisterViewsAndServices()
    {
        this.container.RegisterType&amp;lt;IOrgChartView, OrgChartView&amp;gt;();
    }
} 
&lt;/pre&gt; &lt;br /&gt;The Figure 3 shows the structure of the two modules in the solution explorer.&lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=43205" alt="modules.png" /&gt;&lt;br /&gt;&lt;b&gt;Figure 3&lt;/b&gt;&lt;br /&gt;&lt;i&gt;Modules structure&lt;/i&gt;&lt;br /&gt;&lt;h2&gt;
Creating Views &lt;a name="Views"&gt;&lt;/a&gt;
&lt;/h2&gt;All the views are &lt;b&gt;WPF User Controls&lt;/b&gt;. To implement the view logic this sample implements the Model-View-Presenter pattern.&lt;br /&gt;In the MVP implementation of &lt;b&gt;CAB/SC-SF&lt;/b&gt;, the presenter has a reference to the view interface and the view also has a reference to its presenter. But in the MVP implementation of a &lt;b&gt;Composite WPF&lt;/b&gt; application the view usually does not have a reference to its presenter. The communication between the view and its presenter is achieved by using .NET events.&lt;br /&gt;Another difference is that in &lt;b&gt;CAB/SC-SF&lt;/b&gt; you created the view and the presenter was injected on it. In a &lt;b&gt;Composite WPF&lt;/b&gt; application, the presenter usually drives all the interaction, so the presenters are created using the container (by the &lt;b&gt;Resolve&lt;/b&gt; method) and receives a view passed to its constructor as a parameter. The Dependency Injection container handles the injection.&lt;br /&gt;These are the views used in the WPF Quickstart:&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;EmployeeView&lt;/b&gt; (EmployeeData module): The following classes are required to complete the view logic:&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Employee&lt;/b&gt; class. This is the view model, it is similar to the one used in the original  WPF QuickStart but takes advantage of the C# 3.5 features.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;pre&gt;
public class Employee
{
    public int Id { set; get; }
    public string Name { set; get; }
    public string Position { set; get; }
    public int Age { set; get; }
    public DateTime EmployedOn { set; get; }
} 
&lt;/pre&gt; &lt;br /&gt;&lt;ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;IEmployeeView&lt;/b&gt; interface&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;pre&gt;
public interface IEmployeeView
{
    Employee Model { get; set; }
} 
&lt;/pre&gt; &lt;br /&gt;&lt;ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;EmployeePresenter&lt;/b&gt; class&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;pre&gt;
public class EmployeePresenter
{
    private EmployeeService _employeeService;
 
    public EmployeePresenter(IEmployeeView view, EmployeeService employeeService, IEventAggregator eventAggregator)
    {
        this.View = view;
        this._employeeService = employeeService;
 
        eventAggregator.GetEvent&amp;lt;ShowEmployeeEvent&amp;gt;()
           .Subscribe(SetSelectedEmployee, ThreadOption.UIThread, true);
    }
 
    public void SetSelectedEmployee(int index)
    {
        Employee employee = _employeeService.GetEmployee(index);
        View.Model = employee;
    }
 
    public IEmployeeView View { get; set; }
} 
&lt;/pre&gt; &lt;br /&gt;When the presenter is created, the container resolves its dependencies (the employee view, the employee service and the event aggregator). The presenter subscribes its &lt;b&gt;SetSelectedEmployee&lt;/b&gt; method as a callback for the &lt;b&gt;ShowEmployeeEvent&lt;/b&gt; event.&lt;br /&gt;&lt;ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;EmployeeView&lt;/b&gt; WPF User Control. The following code shows the code behind and the XAML file.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;pre&gt;
public partial class EmployeeView : UserControl, IEmployeeView
{
    public EmployeeView()
    {
        InitializeComponent();
    }
 
    public Employee Model
    {
        get { return this.DataContext as Employee; }
        set { this.DataContext = value; }
    }
} 
&lt;/pre&gt; &lt;br /&gt;&lt;pre&gt;
&amp;lt;UserControl x:Class=&amp;quot;EmployeeData.Views.EmployeeView&amp;quot;
    xmlns=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;
    xmlns:x=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;
    xmlns:local=&amp;quot;clr-namespace:EmployeeData&amp;quot;&amp;gt;
    &amp;lt;GroupBox Header=&amp;quot;Employee Information&amp;quot;&amp;gt;
        &amp;lt;Grid DataContext=&amp;quot;{Binding}&amp;quot;&amp;gt;
            &amp;lt;Grid.ColumnDefinitions&amp;gt;
                &amp;lt;ColumnDefinition&amp;gt;&amp;lt;/ColumnDefinition&amp;gt;
                &amp;lt;ColumnDefinition Width=&amp;quot;5&amp;quot;&amp;gt;&amp;lt;/ColumnDefinition&amp;gt;
            &amp;lt;/Grid.ColumnDefinitions&amp;gt;
            &amp;lt;Grid.RowDefinitions&amp;gt;
                &amp;lt;RowDefinition&amp;gt;&amp;lt;/RowDefinition&amp;gt;
                &amp;lt;RowDefinition&amp;gt;&amp;lt;/RowDefinition&amp;gt;
                &amp;lt;RowDefinition&amp;gt;&amp;lt;/RowDefinition&amp;gt;
                &amp;lt;RowDefinition&amp;gt;&amp;lt;/RowDefinition&amp;gt;
                &amp;lt;RowDefinition&amp;gt;&amp;lt;/RowDefinition&amp;gt;
                &amp;lt;RowDefinition&amp;gt;&amp;lt;/RowDefinition&amp;gt;
                &amp;lt;RowDefinition&amp;gt;&amp;lt;/RowDefinition&amp;gt;
                &amp;lt;RowDefinition&amp;gt;&amp;lt;/RowDefinition&amp;gt;
            &amp;lt;/Grid.RowDefinitions&amp;gt;
            &amp;lt;TextBlock Text=&amp;quot;Name:&amp;quot; Grid.Column=&amp;quot;0&amp;quot; Grid.Row=&amp;quot;0&amp;quot;&amp;gt;&amp;lt;/TextBlock&amp;gt;
            &amp;lt;TextBlock Text=&amp;quot;Position:&amp;quot; Grid.Column=&amp;quot;0&amp;quot; Grid.Row=&amp;quot;2&amp;quot;&amp;gt;&amp;lt;/TextBlock&amp;gt;
            &amp;lt;TextBlock Text=&amp;quot;Age:&amp;quot; Grid.Column=&amp;quot;0&amp;quot; Grid.Row=&amp;quot;4&amp;quot;&amp;gt;&amp;lt;/TextBlock&amp;gt;
            &amp;lt;TextBlock Text=&amp;quot;Employed On:&amp;quot; Grid.Column=&amp;quot;0&amp;quot; Grid.Row=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;/TextBlock&amp;gt;
 
            &amp;lt;TextBox Text=&amp;quot;{Binding Path=Name}&amp;quot; Grid.Column=&amp;quot;0&amp;quot; Grid.Row=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;/TextBox&amp;gt;
            &amp;lt;TextBox Text=&amp;quot;{Binding Path=Position}&amp;quot; Grid.Column=&amp;quot;0&amp;quot; Grid.Row=&amp;quot;3&amp;quot;&amp;gt;&amp;lt;/TextBox&amp;gt;
            &amp;lt;TextBox Text=&amp;quot;{Binding Path=Age}&amp;quot; Grid.Column=&amp;quot;0&amp;quot; Grid.Row=&amp;quot;5&amp;quot;&amp;gt;&amp;lt;/TextBox&amp;gt;
            &amp;lt;TextBox Text=&amp;quot;{Binding Path=EmployedOn}&amp;quot; Grid.Column=&amp;quot;0&amp;quot; Grid.Row=&amp;quot;7&amp;quot;&amp;gt;&amp;lt;/TextBox&amp;gt;
        &amp;lt;/Grid&amp;gt;
    &amp;lt;/GroupBox&amp;gt;
&amp;lt;/UserControl&amp;gt; 
&lt;/pre&gt; &lt;br /&gt;The Figure 4 shows the final design of the view.&lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=43204" alt="EmployeeView.png" /&gt;&lt;br /&gt;&lt;b&gt;Figure 4&lt;/b&gt;&lt;br /&gt;&lt;i&gt;OrgCharView view&lt;/i&gt;&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;OrgChartView&lt;/b&gt; (OrganizationChart module): The following classes are required to complete the view logic:&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;IOrgChartView&lt;/b&gt; interface: Exposes the &lt;b&gt;PositionSelected&lt;/b&gt; event to communicate the view with the presenter (since the view does not have a reference to its presenter).&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;pre&gt;
public interface IOrgChartView
{
    event EventHandler&amp;lt;DataEventArgs&amp;lt;XmlElement&amp;gt;&amp;gt; PositionSelected;
    XmlDocument Model { get; set; }
} 
&lt;/pre&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;OrgChartPresenter&lt;/b&gt; class: The presenter raises the &lt;b&gt;ShowEmployeeEvent&lt;/b&gt; event when a position is selected in the view.&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;
public class OrgChartPresenter
{
    private readonly IEventAggregator _eventAggregator;
 
    public OrgChartPresenter(IOrgChartView view, IEventAggregator eventAggregator)
    {
        this.View = view;
        this._eventAggregator = eventAggregator;
 
        this.View.PositionSelected += delegate(object sender, DataEventArgs&amp;lt;XmlElement&amp;gt; args)
          {
              if (_eventAggregator != null)
              {
                  int selectedEmployeeId = Int32.Parse(args.Value.Attributes[&amp;quot;ID&amp;quot;].Value, CultureInfo.InvariantCulture);
 
                  _eventAggregator.GetEvent&amp;lt;ShowEmployeeEvent&amp;gt;()
                                           .Publish(selectedEmployeeId);
              }
          };
 
        XmlDocument chart = new XmlDocument();
        chart.Load(@&amp;quot;OrganizationChart.xml&amp;quot;);
        View.Model = chart;
    }
 
    public IOrgChartView View { get; set; }
} 
&lt;/pre&gt; &lt;br /&gt;&lt;ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;OrgChartView&lt;/b&gt; WPF User Control. When a user selects a position in the chart, the view raises the &lt;b&gt;PositionSelected&lt;/b&gt; event. The following code shows the view&amp;#180;s code behind.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;table&gt;
&lt;tr&gt;
&lt;td&gt; &lt;b&gt;Note&lt;/b&gt;: The XAML code is not shown here for simplicity purposes. The code is the same as the one used in the original WPF Quickstart. &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt; &lt;br /&gt;&lt;pre&gt;
public partial class OrgChartView : UserControl, IOrgChartView
{
    public OrgChartView()
    {
        InitializeComponent();
    }
 
    public static readonly DependencyProperty OrgChartDataSourceProperty =
        DependencyProperty.Register(&amp;quot;OrgChartDataSource&amp;quot;, typeof(XmlDocument), typeof(OrgChartView), new FrameworkPropertyMetadata(null, new PropertyChangedCallback(OnValueChanged)));
 
    private static void OnValueChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
    {
        OrgChartView control = (OrgChartView)obj;
        XmlDataProvider provider = (XmlDataProvider)control.Resources[&amp;quot;xdpOrgChart&amp;quot;];
        provider.Document = (XmlDocument)args.NewValue;
    }
 
    void SelectionChanged(object sender, RoutedEventArgs e)
    {
        XmlElement element = ((XmlElement)((TreeView)e.Source).SelectedItem);
        PositionSelected(this, new DataEventArgs&amp;lt;XmlElement&amp;gt;(element));
    }
 
    public XmlDocument Model
    {
        get { return (XmlDocument)GetValue(OrgChartDataSourceProperty); }
        set { SetValue(OrgChartDataSourceProperty, value); }
    }
 
    public event EventHandler&amp;lt;DataEventArgs&amp;lt;XmlElement&amp;gt;&amp;gt; PositionSelected = delegate { };
} 
&lt;/pre&gt; &lt;br /&gt;The Figure 5 shows the final design of the view (copied from the &lt;b&gt;WPF Quickstart&lt;/b&gt; source code).&lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=43206" alt="OrgCharView.png" /&gt; &lt;br /&gt;&lt;b&gt;Figure 5&lt;/b&gt;&lt;br /&gt;&lt;i&gt;OrgCharView view&lt;/i&gt;&lt;br /&gt;&lt;h2&gt;
Checking the Results &lt;a name="Results"&gt;&lt;/a&gt;
&lt;/h2&gt;Build and run the final solution by pressing &lt;b&gt;F5&lt;/b&gt;. You will see both views from the &lt;b&gt;EmployeeView&lt;/b&gt; and &lt;b&gt;OrgChartView&lt;/b&gt; views loaded in the Shell:&lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPFContrib&amp;amp;DownloadId=43208" alt="WPFQuickstart.png" /&gt;&lt;br /&gt;&lt;b&gt;Figure 6&lt;/b&gt;&lt;br /&gt;&lt;i&gt;Regenerated Quickstart running&lt;/i&gt;&lt;br /&gt;If you click in a different block in the organization chart of the left view, you will see the corresponding employee information populated in the right view. This is accomplished with the EventAggregator service and the ShowEmployeeEvent event.&lt;br /&gt;
&lt;/div&gt;</description><author>mconverti</author><pubDate>Sun, 07 Sep 2008 20:38:55 GMT</pubDate><guid isPermaLink="false">Updated Wiki: WPFQuickstartRegeneratedWithCAL 20080907083855P</guid></item></channel></rss>