<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://codebetter.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Glenn Block</title><link>http://codebetter.com/blogs/glenn.block/default.aspx</link><description>Another ALT.NET guy at Microsoft
</description><dc:language>en</dc:language><generator>CommunityServer 2007 (Build: 20416.853)</generator><item><title>Firing generic events with EventAggregator</title><link>http://codebetter.com/blogs/glenn.block/archive/2008/08/22/firing-generic-events-with-eventaggregator.aspx</link><pubDate>Fri, 22 Aug 2008 10:08:00 GMT</pubDate><guid isPermaLink="false">d21fbbc9-c112-4f32-ad14-95939a2c53d4:182186</guid><dc:creator>Glenn Block</dc:creator><slash:comments>6</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://codebetter.com/blogs/glenn.block/rsscomments.aspx?PostID=182186</wfw:commentRss><comments>http://codebetter.com/blogs/glenn.block/archive/2008/08/22/firing-generic-events-with-eventaggregator.aspx#comments</comments><description>&lt;p&gt;It&amp;#39;s been a while since i posted anything on Prism. When I left p&amp;amp;p, i said you would see more posts on Prism on my blog. I&amp;#39;ve been pretty immersed in MEF since leaving and haven&amp;#39;t done any posts on Prism yet. Today, I got inspired (albeit late in the evening) based on a post on the forums to actually do that, so here I am :-). The post was from TSChaena about using EventAggregator to fire generic events similar to the way we did things with EventBroker in CAB. Using EventBroker allows you to dynamically define events in your application that are identified through a topic name rather than needing to define a strongly typed class as you do with the EventAggregator. There are several advantages to not using the approach in EB which I have identified in this &lt;a href="http://codebetter.com/blogs/glenn.block/archive/2008/01/07/spiking-around-notification-and-generic-notifiers-part-i.aspx"&gt;post&lt;/a&gt;. However, there are times when you want to do a dynamic eventing system. The good news is that there actually is a solution for doing this with our EventAggreator though it is not exactly the same as the way we did it in EB.&lt;/p&gt;
&lt;h2&gt;CompositeWPFEvent&lt;/h2&gt;
&lt;p&gt;Before we look at the solution I came up with, lets talk quickly about CompositeWPFEvent. CompositeWPFEvent is a generic class that contains one type parameter TPayload. TPayload defines the payload that will be passed into the event when it is fired. The subscriber also uses the payload to provide filters for the subscription. For example if TPayload is a FundOrder as in the EventAggregator QuickStart, then you can supply a lambda such as fundOrder=&amp;gt;fundOrder.CustomeriD == customerID for example to filter on only events that are received for a specific customer. The common pattern you will see for defining such events is to create a class that inherits from CompositeWPFEvent for each event that is typed to the specific paramers. For example below is the definition for the FundOrderAdded event.&lt;/p&gt;
&lt;div&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;class&lt;/span&gt; FundOrderAdded : CompositeWpfEvent&amp;lt;FundOrderAdded&amp;gt; {}&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This event is then retrieved from the EventAggregator by calling the GetEvent method passing FundOrderAdded as the event. Now, although this is the common pattern, there is nothing about the EventAggregator that requires you to create a new event class for each event. CompositeWPFEvent is not an abstract class, so you can simply &amp;quot;use&amp;quot; it as you will, even in a generic case. For example you can do the following.&lt;/p&gt;
&lt;div&gt;
&lt;div style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;   1:&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;class&lt;/span&gt; ThrowsEvents {&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;   2:&lt;/span&gt;   &lt;span style="COLOR:#0000ff;"&gt;public&lt;/span&gt; ThrowsEvents(IEventAggregator eventAgg) {&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;   3:&lt;/span&gt;     eventAgg.GetEvent&amp;lt;CompositeWPFEvent&amp;lt;&lt;span style="COLOR:#0000ff;"&gt;string&lt;/span&gt;&amp;gt;&amp;gt;().Publish(&lt;span style="COLOR:#006080;"&gt;&amp;quot;SomethingEvent&amp;quot;&lt;/span&gt;)&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;   4:&lt;/span&gt;     eventAgg.GetEvent&amp;lt;CompositeWPFEvent&amp;lt;&lt;span style="COLOR:#0000ff;"&gt;string&lt;/span&gt;&amp;gt;&amp;gt;().Publish(&lt;span style="COLOR:#006080;"&gt;&amp;quot;SomethingElseEvent&amp;quot;&lt;/span&gt;)&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;   5:&lt;/span&gt;   }&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;   6:&lt;/span&gt; }&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;   7:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;   8:&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;class&lt;/span&gt; HandlesEvents {&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;   9:&lt;/span&gt;   &lt;span style="COLOR:#0000ff;"&gt;public&lt;/span&gt; HandlesEvents(IEventAggregator eventAgg) {&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;  10:&lt;/span&gt;     CompositeWPFEvent genericEvent = eventAgg.GetEvent&amp;lt;CompositeWPFEvent&amp;lt;&lt;span style="COLOR:#0000ff;"&gt;string&lt;/span&gt;&amp;gt;&amp;gt;();&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;  11:&lt;/span&gt;     genericEvent.Subscribe(action=&amp;gt;Console.WriteLine(&lt;span style="COLOR:#006080;"&gt;&amp;quot;SomethingEvent fired&amp;quot;&lt;/span&gt;, ThreadOption.UIThread, &lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;  12:&lt;/span&gt;       &lt;span style="COLOR:#0000ff;"&gt;false&lt;/span&gt;, e=&amp;gt;e == &lt;span style="COLOR:#006080;"&gt;&amp;quot;SomethingEvent&amp;quot;&lt;/span&gt;);&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;  13:&lt;/span&gt;     genericEvent.Subscribe(action=&amp;gt;Console.WriteLine(&lt;span style="COLOR:#006080;"&gt;&amp;quot;SomethingElseEvent fired&amp;quot;&lt;/span&gt;, ThreadOption.UIThread, &lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;  14:&lt;/span&gt;       &lt;span style="COLOR:#0000ff;"&gt;false&lt;/span&gt;, e=&amp;gt;e == &lt;span style="COLOR:#006080;"&gt;&amp;quot;SomethingElseEvent&amp;quot;&lt;/span&gt;);&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;  15:&lt;/span&gt;   } &lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;  16:&lt;/span&gt; }&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;If you look at the above code, you&amp;#39;ll notice that we are using CompositeWPFEvent event directly, rather than creating a specific inheritor. When we call for the event from the aggregator, we are passing in a param of type string which represents the EventName / Topic. I am then using our event subscription mechanism to subscribe two different handlers to the same &amp;quot;event&amp;quot; by using the eventName as the filter. So here we have the basics of doing generic event publication and subscription. However, we are missing something important....that payload :). To handle this, you could instead create your own custom class that carries two parameters, EventName, and Value. With that approach, you can pass both the event name and the value, still filter on the event, and you can pass a value along. For example the above code passing&amp;nbsp; a value would look like the following.&lt;/p&gt;
&lt;div&gt;
&lt;div style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;   1:&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;class&lt;/span&gt; SomeEventParams {&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;   2:&lt;/span&gt;   &lt;span style="COLOR:#0000ff;"&gt;public&lt;/span&gt; SomeEventParams(&lt;span style="COLOR:#0000ff;"&gt;string&lt;/span&gt; eventName, &lt;span style="COLOR:#0000ff;"&gt;object&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;value&lt;/span&gt;) {&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;   3:&lt;/span&gt;     EventName = eventName;&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;   4:&lt;/span&gt;     Value = &lt;span style="COLOR:#0000ff;"&gt;value&lt;/span&gt;;&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;   5:&lt;/span&gt;   }&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;   6:&lt;/span&gt;   &lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;   7:&lt;/span&gt;   &lt;span style="COLOR:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;string&lt;/span&gt; EventName {get;&lt;span style="COLOR:#0000ff;"&gt;private&lt;/span&gt; set;}&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;   8:&lt;/span&gt;   &lt;span style="COLOR:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;object&lt;/span&gt; Value {get; &lt;span style="COLOR:#0000ff;"&gt;private&lt;/span&gt; set;}&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;   9:&lt;/span&gt; }&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;  10:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;  11:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;  12:&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;class&lt;/span&gt; ThrowsEvents {&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;  13:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;  14:&lt;/span&gt;   &lt;span style="COLOR:#0000ff;"&gt;public&lt;/span&gt; ThrowsEvents(IEventAggregator eventAgg) {&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;  15:&lt;/span&gt;     eventAgg.GetEvent&amp;lt;CompositeWPFEvent&amp;lt;SomeEventParams&amp;gt;&amp;gt;().Publish(&lt;span style="COLOR:#0000ff;"&gt;new&lt;/span&gt; SomeEventParams(&lt;span style="COLOR:#006080;"&gt;&amp;quot;SomethingEvent&amp;quot;&lt;/span&gt;,&lt;span style="COLOR:#006080;"&gt;&amp;quot;SomeValue&amp;quot;&lt;/span&gt;));&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;  16:&lt;/span&gt;     eventAgg.GetEvent&amp;lt;CompositeWPFEvent&amp;lt;SomeEventParams&amp;gt;&amp;gt;().Publish(&lt;span style="COLOR:#0000ff;"&gt;new&lt;/span&gt; SomeEventParams(&lt;span style="COLOR:#006080;"&gt;&amp;quot;SomethingElseEvent&amp;quot;&lt;/span&gt;, &lt;span style="COLOR:#006080;"&gt;&amp;quot;SomeOtherValue&amp;quot;&lt;/span&gt;));&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;  17:&lt;/span&gt;   }&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;  18:&lt;/span&gt; }&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;  19:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;  20:&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;class&lt;/span&gt; HandlesEvents {&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;  21:&lt;/span&gt;   &lt;span style="COLOR:#0000ff;"&gt;public&lt;/span&gt; HandlesEvents(IEventAggregator eventAgg) {&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;  22:&lt;/span&gt;     CompositeWPFEvent genericEvent = eventAgg.GetEvent&amp;lt;CompositeWPFEvent&amp;lt;&lt;span style="COLOR:#0000ff;"&gt;string&lt;/span&gt;&amp;gt;&amp;gt;();&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;  23:&lt;/span&gt;     genericEvent.Subscribe(action=&amp;gt;Console.WriteLine(&lt;span style="COLOR:#006080;"&gt;&amp;quot;SomethingEvent fired&amp;quot;&lt;/span&gt; + action.Value, ThreadOption.UIThread, &lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;  24:&lt;/span&gt;       &lt;span style="COLOR:#0000ff;"&gt;false&lt;/span&gt;, e=&amp;gt;e.EventName == &lt;span style="COLOR:#006080;"&gt;&amp;quot;SomethingEvent&amp;quot;&lt;/span&gt;);&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;  25:&lt;/span&gt;     genericEvent.Subscribe(action=&amp;gt;Console.WriteLine(&lt;span style="COLOR:#006080;"&gt;&amp;quot;SomethingElseEvent fired&amp;quot;&lt;/span&gt; + action.Value, ThreadOption.UIThread, &lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;  26:&lt;/span&gt;       &lt;span style="COLOR:#0000ff;"&gt;false&lt;/span&gt;, e=&amp;gt;e.EventName == &lt;span style="COLOR:#006080;"&gt;&amp;quot;SomethingElseEvent&amp;quot;&lt;/span&gt;);&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;  27:&lt;/span&gt;   } &lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#606060;"&gt;  28:&lt;/span&gt; }&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;That&amp;#39;s OK, except now the parameters are simply object. That means we are losing the type safety that the EventAgg was built for in the first place! Now you can further refactor and make SomeEventParams a generic type that accepts a type param for the value. The only downside of this, is the code will get much more verbose and harder to read. For example retrieving the event to publish will now look like...&lt;/p&gt;
&lt;div&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;eventAgg.GetEvent&amp;lt;CompositeWPFEvent&amp;lt;SomeEventParams&amp;lt;&lt;span style="COLOR:#0000ff;"&gt;string&lt;/span&gt;&amp;gt;&amp;gt;().Publish...&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Suboptimal. I bet your thinking you could refactor this a bit more..yes, you can. This is what led me to a GenericEvent.&lt;/p&gt;
&lt;h2&gt;&lt;/h2&gt;
&lt;h3&gt;&lt;/h3&gt;
&lt;h2&gt;GenericEvent&lt;/h2&gt;
&lt;p&gt;If we keep refactoring, we can get rid of alot of the DRY behavior, by creating an inheritor of CompositeWPFEvent, GenericEvent. The event and associated parameters class looks like this&lt;/p&gt;
&lt;div&gt;
&lt;div style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;class&lt;/span&gt; EventParameters&amp;lt;TValue&amp;gt;&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;{&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;  &lt;span style="COLOR:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;string&lt;/span&gt; Topic { get; &lt;span style="COLOR:#0000ff;"&gt;private&lt;/span&gt; set; }&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;  &lt;span style="COLOR:#0000ff;"&gt;public&lt;/span&gt; TValue Value { get; &lt;span style="COLOR:#0000ff;"&gt;private&lt;/span&gt; set; }&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;  &lt;span style="COLOR:#0000ff;"&gt;public&lt;/span&gt; EventParameters(&lt;span style="COLOR:#0000ff;"&gt;string&lt;/span&gt; topic, TValue &lt;span style="COLOR:#0000ff;"&gt;value&lt;/span&gt;)&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;  {&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;    Topic = topic;&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;    Value = &lt;span style="COLOR:#0000ff;"&gt;value&lt;/span&gt;;&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;  }&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;}&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;class&lt;/span&gt; GenericEvent&amp;lt;TValue&amp;gt; : CompositeWpfEvent&amp;lt;EventParameters&amp;lt;TValue&amp;gt;&amp;gt; {}&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Subscribing and publishing is now easier as well. The previous GetEvent code now looks like&lt;/p&gt;
&lt;div&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;eventAgg.GetEvent&amp;lt;GenericEvent&amp;lt;&lt;span style="COLOR:#0000ff;"&gt;string&lt;/span&gt;&amp;gt;().Publish...&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Because I have strongly typed my Value, I know have back my strongly typed filters and delegates. &lt;/p&gt;
&lt;h2&gt;Putting the rubber to the road with the EventAggregation QuickStart.&lt;/h2&gt;
&lt;p&gt;In order to test this out, I took a copy of the EventAggregaton QuickStart that is included with the Prism bits, and I modified it to use the new GenericEvent. I also added a Remove button to the QS in order to demonstrate using more than one event. The new Quickstart looks like the following.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://codebetter.com/blogs/glenn.block/WindowsLiveWriter/FiringgenericeventswithEventAggregator_2A11/image_4.png"&gt;&lt;img style="BORDER-TOP-WIDTH:0px;BORDER-LEFT-WIDTH:0px;BORDER-BOTTOM-WIDTH:0px;BORDER-RIGHT-WIDTH:0px;" height="526" alt="image" src="http://codebetter.com/blogs/glenn.block/WindowsLiveWriter/FiringgenericeventswithEventAggregator_2A11/image_thumb_1.png" width="689" border="0" /&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In the new version of the Quickstart, the FundOrderAddedEvent is removed. Instead, I have added two constants to define the different events.&lt;/p&gt;
&lt;div&gt;
&lt;div style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;class&lt;/span&gt; Events&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;{&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;  &lt;span style="COLOR:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;const&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;string&lt;/span&gt; FundAdded = &lt;span style="COLOR:#006080;"&gt;&amp;quot;FundAdded&amp;quot;&lt;/span&gt;;&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;  &lt;span style="COLOR:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;const&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;string&lt;/span&gt; FundRemoved = &lt;span style="COLOR:#006080;"&gt;&amp;quot;FundRemoved&amp;quot;&lt;/span&gt;;&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I added a RemoveFund method to the AddFundPresenter as well as refactored the AddFund method as follows.&lt;/p&gt;
&lt;div&gt;
&lt;div style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#0000ff;"&gt;void&lt;/span&gt; RemoveFund(&lt;span style="COLOR:#0000ff;"&gt;object&lt;/span&gt; sender, EventArgs e)&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;{&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;    FundOrder fundOrder = &lt;span style="COLOR:#0000ff;"&gt;new&lt;/span&gt; FundOrder();&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;    fundOrder.CustomerId = View.Customer;&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;    fundOrder.TickerSymbol = View.Fund;&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;    &lt;span style="COLOR:#0000ff;"&gt;if&lt;/span&gt; (!&lt;span style="COLOR:#0000ff;"&gt;string&lt;/span&gt;.IsNullOrEmpty(fundOrder.CustomerId) &amp;amp;&amp;amp; !&lt;span style="COLOR:#0000ff;"&gt;string&lt;/span&gt;.IsNullOrEmpty(fundOrder.TickerSymbol))&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;        eventAggregator.GetEvent&amp;lt;GenericEvent&amp;lt;FundOrder&amp;gt;&amp;gt;().&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;          Publish(&lt;span style="COLOR:#0000ff;"&gt;new&lt;/span&gt; EventParameters&amp;lt;FundOrder&amp;gt;(Events.FundRemoved, fundOrder));&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;    &lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;}&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#0000ff;"&gt;void&lt;/span&gt; AddFund(&lt;span style="COLOR:#0000ff;"&gt;object&lt;/span&gt; sender, EventArgs e)&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;{&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;    FundOrder fundOrder = &lt;span style="COLOR:#0000ff;"&gt;new&lt;/span&gt; FundOrder();&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;    fundOrder.CustomerId = View.Customer;&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;    fundOrder.TickerSymbol = View.Fund;&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;    &lt;span style="COLOR:#0000ff;"&gt;if&lt;/span&gt; (!&lt;span style="COLOR:#0000ff;"&gt;string&lt;/span&gt;.IsNullOrEmpty(fundOrder.CustomerId) &amp;amp;&amp;amp; !&lt;span style="COLOR:#0000ff;"&gt;string&lt;/span&gt;.IsNullOrEmpty(fundOrder.TickerSymbol))&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;        eventAggregator.GetEvent&amp;lt;GenericEvent&amp;lt;FundOrder&amp;gt;&amp;gt;().&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;          Publish(&lt;span style="COLOR:#0000ff;"&gt;new&lt;/span&gt; EventParameters&amp;lt;FundOrder&amp;gt;(Events.FundAdded, fundOrder));&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Finally, I refactored the ActivityPresenter in a similar fashion&lt;/p&gt;
&lt;div&gt;
&lt;div style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;string&lt;/span&gt; CustomerId&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;{&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;    get { &lt;span style="COLOR:#0000ff;"&gt;return&lt;/span&gt; _customerId; }&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;    set&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;    {&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;        _customerId = &lt;span style="COLOR:#0000ff;"&gt;value&lt;/span&gt;;&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;        GenericEvent&amp;lt;FundOrder&amp;gt; fundOrderEvent = eventAggregator.GetEvent&amp;lt;GenericEvent&amp;lt;FundOrder&amp;gt;&amp;gt;();&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;        &lt;span style="COLOR:#0000ff;"&gt;if&lt;/span&gt; (fundAddedSubscriptionToken != &lt;span style="COLOR:#0000ff;"&gt;null&lt;/span&gt;)&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;        {&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;            fundOrderEvent.Unsubscribe(fundAddedSubscriptionToken);&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;            fundOrderEvent.Unsubscribe(fundRemovedSubscriptionToken);&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;            &lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;        }&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;        fundAddedSubscriptionToken = fundOrderEvent.Subscribe(FundAddedEventHandler, ThreadOption.UIThread, &lt;span style="COLOR:#0000ff;"&gt;false&lt;/span&gt;,&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;                                                     parms =&amp;gt; parms.Topic == Events.FundAdded &amp;amp;&amp;amp; parms.Value.CustomerId == _customerId);&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;        fundRemovedSubscriptionToken = fundOrderEvent.Subscribe(FundRemovedEventHandler, ThreadOption.UIThread, &lt;span style="COLOR:#0000ff;"&gt;false&lt;/span&gt;,&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;                                                     parms =&amp;gt; parms.Topic == Events.FundRemoved &amp;amp;&amp;amp; parms.Value.CustomerId == _customerId);&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;        View.Title = &lt;span style="COLOR:#0000ff;"&gt;string&lt;/span&gt;.Format(CultureInfo.CurrentCulture, Resources.ActivityTitle, CustomerId);&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;    }&lt;/pre&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:white;BORDER-BOTTOM-STYLE:none;"&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Notice how in the subscription I am now filteirng on the event Topic in addition to the value. This is the result of moving to a generic event.&lt;/p&gt;
&lt;h2&gt;&lt;/h2&gt;
&lt;h2&gt;Wrapping Up&lt;/h2&gt;
&lt;p&gt;Using the approach show in this post, we&amp;#39;ve seen how you can utilize the existing EventAggregator infrastructure to do generic eventing similar to the way EventBroker in CAB functions. &lt;/p&gt;
&lt;p&gt;Personally I think using strongly typed specific events is more maintainable. The reasoning is because the event payload type is intrinsically defined to the event wheras in this model they are not. For example with generic events I might have an event that publishes passing a customer, but on the receiving side I have&amp;nbsp; defined it as a string. This event will never get handled, because the susbscriber and publisher don&amp;#39;t match. If you use strongly typed events that is not the case, as the type is the match ;) However there are scenarios where it may make sense to have something more dynamic, for example if you have a metadata driven system that needs to do dynamic wiring.&lt;/p&gt;
&lt;p&gt;Attached, you&amp;#39;ll find the code for my modified version of the QuickStart. Let me know if this works for you. Now time to get some sleep :)&lt;/p&gt;&lt;img src="http://codebetter.com/aggbug.aspx?PostID=182186" width="1" height="1"&gt;</description><enclosure url="http://codebetter.com/blogs/glenn.block/attachment/182186.ashx" length="709218" type="application/x-zip-compressed" /><category domain="http://codebetter.com/blogs/glenn.block/archive/tags/Composite+Application+Guidance/default.aspx">Composite Application Guidance</category><category domain="http://codebetter.com/blogs/glenn.block/archive/tags/Composite+WPF/default.aspx">Composite WPF</category><category domain="http://codebetter.com/blogs/glenn.block/archive/tags/prism/default.aspx">prism</category></item><item><title>ForEach, a simple but very useful extension method</title><link>http://codebetter.com/blogs/glenn.block/archive/2008/08/19/foreach-a-simple-but-very-useful-extension-method.aspx</link><pubDate>Tue, 19 Aug 2008 07:46:00 GMT</pubDate><guid isPermaLink="false">d21fbbc9-c112-4f32-ad14-95939a2c53d4:182099</guid><dc:creator>Glenn Block</dc:creator><slash:comments>22</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://codebetter.com/blogs/glenn.block/rsscomments.aspx?PostID=182099</wfw:commentRss><comments>http://codebetter.com/blogs/glenn.block/archive/2008/08/19/foreach-a-simple-but-very-useful-extension-method.aspx#comments</comments><description>&lt;p&gt;This evening I was writing some code (Yay!) for an Xml based MEF catalog I am prototyping. I came across the need to invoke a set of methods on an IEnumerable&amp;lt;T&amp;gt; that was returned from a LINQ to XML query. Unfortunately no such animal exists on IEnumerable.&lt;/p&gt;  &lt;p&gt;It took me &amp;lt; 5 mins to write this&lt;/p&gt;  &lt;div&gt;   &lt;div style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;     &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   1:&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;static&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;class&lt;/span&gt; IEnumerableUtils&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   3:&lt;/span&gt;       &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;static&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; ForEach&amp;lt;T&amp;gt;(&lt;span style="color:#0000ff;"&gt;this&lt;/span&gt; IEnumerable&amp;lt;T&amp;gt; collection, Action&amp;lt;T&amp;gt; action)&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   4:&lt;/span&gt;       {&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   5:&lt;/span&gt;         &lt;span style="color:#0000ff;"&gt;foreach&lt;/span&gt;(T item &lt;span style="color:#0000ff;"&gt;in&lt;/span&gt; collection)&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   6:&lt;/span&gt;           action(item);&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   7:&lt;/span&gt;       }&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   8:&lt;/span&gt; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Any questions?&lt;/p&gt;&lt;img src="http://codebetter.com/aggbug.aspx?PostID=182099" width="1" height="1"&gt;</description><category domain="http://codebetter.com/blogs/glenn.block/archive/tags/LINQ/default.aspx">LINQ</category><category domain="http://codebetter.com/blogs/glenn.block/archive/tags/misc/default.aspx">misc</category></item><item><title>Prism, MEF and DI oh my</title><link>http://codebetter.com/blogs/glenn.block/archive/2008/08/18/prism-mef-and-di-oh-my.aspx</link><pubDate>Tue, 19 Aug 2008 06:43:53 GMT</pubDate><guid isPermaLink="false">d21fbbc9-c112-4f32-ad14-95939a2c53d4:182095</guid><dc:creator>Glenn Block</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://codebetter.com/blogs/glenn.block/rsscomments.aspx?PostID=182095</wfw:commentRss><comments>http://codebetter.com/blogs/glenn.block/archive/2008/08/18/prism-mef-and-di-oh-my.aspx#comments</comments><description>&lt;p&gt;&lt;a href="http://codebetter.com/blogs/glenn.block/WindowsLiveWriter/PrismMEFandDIohmy_14C62/herdingCode-165px_2.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="169" alt="herdingCode-165px" src="http://codebetter.com/blogs/glenn.block/WindowsLiveWriter/PrismMEFandDIohmy_14C62/herdingCode-165px_thumb.png" width="169" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;A few weeks ago I had a chance to chance to chat with the gang over at&amp;#160; &lt;a href="http://herdingcode.com/"&gt;Herding Code&lt;/a&gt; on all of the above. I was in a particularly talkative mood after coming from a full day of presenting at Tech-Ready, so I&amp;#39;ll warn you that there might be some rambling. As a result the podcast was split into two parts. In the first part we discuss Prism and DI in general. In the second part we delve into the specifics of MEF, and whether or not it is the one true DI container to unite them all ;) The best part is at the end when I get to turn the tables and put them in the hot seat :)&lt;/p&gt;  &lt;p&gt;I had a great time hanging out with those guys, well virtually at least. I really like the open round table style format of the podcast. Check it out below.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://herdingcode.com/?p=28"&gt;Episode 11: Glenn Block on Prism, Unity, and MEF (part 1)&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://herdingcode.com/?p=31"&gt;Episode 12: Glenn Block on Prism, Unity, and MEF (part 2)&lt;/a&gt;&lt;/p&gt;&lt;img src="http://codebetter.com/aggbug.aspx?PostID=182095" width="1" height="1"&gt;</description><category domain="http://codebetter.com/blogs/glenn.block/archive/tags/Composite+Application+Guidance/default.aspx">Composite Application Guidance</category><category domain="http://codebetter.com/blogs/glenn.block/archive/tags/Composite+WPF/default.aspx">Composite WPF</category><category domain="http://codebetter.com/blogs/glenn.block/archive/tags/MEF/default.aspx">MEF</category><category domain="http://codebetter.com/blogs/glenn.block/archive/tags/prism/default.aspx">prism</category></item><item><title>Composite Application Guidance Talk at Tech-Ed</title><link>http://codebetter.com/blogs/glenn.block/archive/2008/08/08/composite-application-guidance-talk-at-tech-ed.aspx</link><pubDate>Fri, 08 Aug 2008 22:09:00 GMT</pubDate><guid isPermaLink="false">d21fbbc9-c112-4f32-ad14-95939a2c53d4:181752</guid><dc:creator>Glenn Block</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://codebetter.com/blogs/glenn.block/rsscomments.aspx?PostID=181752</wfw:commentRss><comments>http://codebetter.com/blogs/glenn.block/archive/2008/08/08/composite-application-guidance-talk-at-tech-ed.aspx#comments</comments><description>&lt;p&gt;Several months ago, &lt;a href="http://www.softinsight.com/bnoyes/2008/06/07/TechEdSessionsDoneWIN306SOA305SOA308TLC.aspx"&gt;Brian Noyes&lt;/a&gt; and I delivered a talk on &lt;a href="http://www.microsoft.com/compositewpf"&gt;Composite App Guidance&lt;/a&gt; AKA Prism at Tech-Ed USA. In the talk we discuss the essentials of Prism and do a bunch of demonstrations (well Brian did) of how to use it&amp;#39;s various components. The talk went really well and the feedback we got was people really like what they were seeing. Brian also rocked the stage with his demo magic. If you attended Tech-Ed you can see it live on the Tech-Ed Virtual DVD site by following these simple (and convoluted) steps. You will need to install the latest version of Silverlight to see the video.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Click this &lt;a href="https://www1.msteched.com/dev/"&gt;link&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Log in using your conference site credentials &lt;/li&gt;
&lt;li&gt;Click the Tech-Ed Online DVD - Dev link on the left &lt;/li&gt;
&lt;li&gt;Click View Sessions along the top &lt;/li&gt;
&lt;li&gt;Enter win306 in the keywords &lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;If you are not able to log-in, then you can download the slides from the talk below. &lt;/p&gt;
&lt;p&gt;&lt;a href="http://cid-92d0758f33773822.skydrive.live.com/self.aspx/Tech-Ed/Composite%20Application%20Guidance.pptx"&gt;http://cid-92d0758f33773822.skydrive.live.com/self.aspx/Tech-Ed/Composite%20Application%20Guidance.pptx&lt;/a&gt;&lt;/p&gt;&lt;img src="http://codebetter.com/aggbug.aspx?PostID=181752" width="1" height="1"&gt;</description><category domain="http://codebetter.com/blogs/glenn.block/archive/tags/Composite+Application+Guidance/default.aspx">Composite Application Guidance</category><category domain="http://codebetter.com/blogs/glenn.block/archive/tags/Composite+WPF/default.aspx">Composite WPF</category><category domain="http://codebetter.com/blogs/glenn.block/archive/tags/talks/default.aspx">talks</category><category domain="http://codebetter.com/blogs/glenn.block/archive/tags/tech-ed+developers/default.aspx">tech-ed developers</category><category domain="http://codebetter.com/blogs/glenn.block/archive/tags/WPF/default.aspx">WPF</category></item><item><title>Me + MEF = A new beginning</title><link>http://codebetter.com/blogs/glenn.block/archive/2008/07/16/me-mef-a-new-beginning.aspx</link><pubDate>Wed, 16 Jul 2008 17:44:00 GMT</pubDate><guid isPermaLink="false">d21fbbc9-c112-4f32-ad14-95939a2c53d4:180891</guid><dc:creator>Glenn Block</dc:creator><slash:comments>9</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://codebetter.com/blogs/glenn.block/rsscomments.aspx?PostID=180891</wfw:commentRss><comments>http://codebetter.com/blogs/glenn.block/archive/2008/07/16/me-mef-a-new-beginning.aspx#comments</comments><description>&lt;p&gt;About three months ago, we were on the heels of shipping &lt;a href="http://codebetter.com/blogs/glenn.block/archive/2008/07/02/composite-application-guidance-is-live.aspx"&gt;Prism (Composite Application Guidance).&lt;/a&gt; At that time, I went to Don Smith my then manager ecstatically and said &amp;quot;Man I just love being in p&amp;amp;p, this is amazing&amp;quot;. What I meant is that I love the work we are doing, I love the way we listen to customers, I love our ability to shift our direction based on what we are hearing and I love the &lt;a href="http://blogs.msdn.com/gblock/archive/2008/04/27/the-prism-team-and-how-we-develop.aspx"&gt;environment&lt;/a&gt; we operate in to make it happen. Prism was a prime example of that in that we changed a lot of the way we do things, and incorporated a lot of new concepts that were resonating with the community. In many ways we got &lt;a href="http://blogs.msdn.com/gblock/archive/2008/05/08/prism-vs-framework-xxx.aspx"&gt;back to basics&lt;/a&gt;. When I made that statement to Don, I imagined I&amp;#39;d be in p&amp;amp;p for years to come.&lt;/p&gt;
&lt;p&gt;Lo and behold about two weeks after that conversation, I get an email from &lt;a href="http://blogs/msdn.com/brada"&gt;Brad Abrams&lt;/a&gt; saying we should have lunch and chat about the work going in the &lt;a href="http://blogs.msdn.com/kcwalina/archive/2008/04/25/MEF.aspx"&gt;MEF&lt;/a&gt; team, and how it might be a good place for me. Initially I thought to myself, no way. It had nothing to do with MEF, but there was absolutely NO reason for me to leave, and on top of that I had a fantastic year in p&amp;amp;p. However, because it was Brad asking, I said I need to at least go and hear what this is about. Over the past 18 months, I had worked with Brad on many occasions and have deep respect for him.&lt;/p&gt;
&lt;p&gt;Lunch changed everything :) As Brad described MEF, it became very clear to me that the challenges MEF is solving in many was is a framework answer to problems we&amp;#39;ve addressing in p&amp;amp;p. Here was an opportunity to take those experiences and the work with the community, and&amp;nbsp; bring it to the platform. Coming to MEF raised several concerns. Can I continue being who&amp;nbsp; I am? Can&amp;nbsp; I continue pushing to try new approaches? Can I keep engaging with the community including our friends from the OSS community? Can I keep being &lt;a href="http://www.twitter.com/gblock"&gt;open&lt;/a&gt;? Oh and can I keep being Test-Driven?&lt;/p&gt;
&lt;p&gt;The answers Brad gave were all &lt;strong&gt;YES &lt;/strong&gt;except to the test-driven part, at least not yet :)&lt;strong&gt; &lt;/strong&gt;Basically he said keep doing what your doing, only do it as a member of the .NET Framework team......Too good to resist. At that moment I decided YES this is right. My wife on the other hand though I was completely nuts. She said, &amp;quot;You are so happy, why leave&amp;quot;. I said &amp;quot;honey, you don&amp;#39;t understand...THIS IS THE FRAMEWORK! THIS IS &lt;a href="http://weblogs.asp.net/scottgu/"&gt;SCOTT GU&amp;#39;s&lt;/a&gt; org.&amp;quot; I tried to also explain to her the significance of working with luminaries like &lt;a href="http://blogs.msdn.com/kcwalina/"&gt;Krzysztof&lt;/a&gt;, Brad and Blake.&amp;nbsp; Her response &amp;quot;Whatever, I hope you know what you are doing&amp;quot;&lt;/p&gt;
&lt;p&gt;So after several informal chats with the team, followed by an interview loop, here I am as a new PM on the MEF team, and have been for the last two weeks. Originally I wasn&amp;#39;t planning to post yet, however yesterday I saw Hammett let the &lt;a href="http://hammett.castleproject.org/?p=312"&gt;cat out of the bag&lt;/a&gt; about his joining us, so I thought I shouldn&amp;#39;t wait :)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://codebetter.com/blogs/glenn.block/WindowsLiveWriter/MeMEFAnewbeginning_9722/image_2.png"&gt;&lt;img style="BORDER-RIGHT:0px;BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:0px;" height="65" alt="image" src="http://codebetter.com/blogs/glenn.block/WindowsLiveWriter/MeMEFAnewbeginning_9722/image_thumb.png" width="587" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;It&amp;#39;s been a great start. This is a space I know pretty well and it is a terrific team. Because of both, the ramp up has been smooth. I&amp;#39;ve been pushing on several areas since joining. One of which is how to get more visibility in what we are doing with the community. I am happy to say that as a team we&amp;#39;ve agreed to push our source to CodePlex and join our &lt;a href="http://haacked.com/"&gt;friends&lt;/a&gt; over in MVC land.&amp;nbsp; We&amp;#39;ve got buy in on the team, now we just need to clear it with the lawyers :-) Regardless, you&amp;#39;ll here much more in the near feature on the work we were doing and how you can help us.&lt;/p&gt;
&lt;p&gt;As to p&amp;amp;p there will always be a place in my heart. I really have had an amazing experience working with folks there. Forgetting the amazing projects we worked on, it&amp;#39;s the people. I can&amp;#39;t name all, so I won&amp;#39;t name any. All I can say that it&amp;#39;s been a great&amp;nbsp;wild ride :)&amp;nbsp; They haven&amp;#39;t seen the last of me, the very fact that I am working on MEF means we&amp;#39;ll be traveling together for a long time :)&lt;/p&gt;&lt;img src="http://codebetter.com/aggbug.aspx?PostID=180891" width="1" height="1"&gt;</description><category domain="http://codebetter.com/blogs/glenn.block/archive/tags/MEF/default.aspx">MEF</category></item><item><title>Composite Application Guidance is Live</title><link>http://codebetter.com/blogs/glenn.block/archive/2008/07/02/composite-application-guidance-is-live.aspx</link><pubDate>Thu, 03 Jul 2008 06:19:00 GMT</pubDate><guid isPermaLink="false">d21fbbc9-c112-4f32-ad14-95939a2c53d4:180279</guid><dc:creator>Glenn Block</dc:creator><slash:comments>7</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://codebetter.com/blogs/glenn.block/rsscomments.aspx?PostID=180279</wfw:commentRss><comments>http://codebetter.com/blogs/glenn.block/archive/2008/07/02/composite-application-guidance-is-live.aspx#comments</comments><description>&lt;p&gt;Before I go any further, we shipped! :-)&lt;/p&gt;  &lt;p&gt;Links:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a class="" href="http://msdn.microsoft.com/en-us/library/cc707819.aspx"&gt;Composite Application Guidance Landing Page&lt;/a&gt; (will be at &lt;a href="http://msdn.microsoft.com/compositewpf"&gt;http://msdn.microsoft.com/compositewpf&lt;/a&gt;) &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=6DD3D0C1-D5B4-453B-B827-98E162E1BD8D&amp;amp;displaylang=en"&gt;Composite Application Guidance&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;h2&gt;What&amp;#39;s in the box&lt;/h2&gt;  &lt;p&gt;Here&amp;#39;s an overview of what you&amp;#39;ll find&lt;/p&gt;  &lt;p&gt;&lt;a href="http://codebetter.com/blogs/glenn.block/WindowsLiveWriter/CompositeApplicationGuidanceisLive_1479E/image_4.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="286" alt="image" src="http://codebetter.com/blogs/glenn.block/WindowsLiveWriter/CompositeApplicationGuidanceisLive_1479E/image_thumb_1.png" width="599" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;At the core is the Stock Trader Reference Implementation. &lt;/p&gt;  &lt;p&gt;&lt;img height="221" alt="RIScreenshots_small.png" src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=CompositeWPF&amp;amp;DownloadId=37985" width="612" /&gt;&lt;/p&gt;  &lt;p&gt;This app is a composite application built in WPF. In it you&amp;#39;ll find design patterns, concepts and techniques you can add to your arsenal.&lt;/p&gt;  &lt;p&gt;Supporting the RI, you&amp;#39;ll find a library which aids in implementing the patterns. The library is light, really light and that&amp;#39;s deliberate. We harvested it out of the RI rather than building it first and throwing an app on top. We built it to work with your existing infrastructure rather than you having to build from scratch on top of it. We built it to work 100% with WPF rather than retrofitting WinForm concepts into a WPF world. &lt;/p&gt;  &lt;p&gt;Around the RI, you&amp;#39;ll find comprehensive documentation (see the diagram above) in which you&amp;#39;ll see the major design concepts and patterns are for building composites such as the RI. You can use this knowledge to build your own implementations if you decide that ours is not right for you. You&amp;#39;ll also learn how we&amp;#39;ve decided to implement those patterns and concepts and why. You&amp;#39;ll see how to use the pieces separately, or put them together in a coherent fashion to form the baseline architecture you see below. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://codebetter.com/blogs/glenn.block/WindowsLiveWriter/CompositeApplicationGuidanceisLive_1479E/image_2.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="468" alt="image" src="http://codebetter.com/blogs/glenn.block/WindowsLiveWriter/CompositeApplicationGuidanceisLive_1479E/image_thumb.png" width="594" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Finally you&amp;#39;ll find a set of quickstarts and how-tos to help you get ramped up on the concepts.&lt;/p&gt;  &lt;h2&gt;A little history&lt;/h2&gt;  &lt;p&gt;If you&amp;#39;d have asked me 12 months ago, I would have said this day would have never come. Around that time we had just announced that we had no further plans to do anything in the CAB space. Instead our goal was to lead everyone toward a mythical creature called &lt;a href="http://blogs.msdn.com/gblock/archive/2007/06/06/acropolis-the-future-of-smart-client.aspx"&gt;Acropolis&lt;/a&gt;. With Acropolis on the way it didn&amp;#39;t make sense for us to continue. Then by some strange twist of &lt;a href="http://blogs.msdn.com/acropolis/archive/2007/10/29/An-Acropolis-Update.aspx"&gt;fate&lt;/a&gt;, Acropolis was folded into future versions of the framework. This opened the door for us to address building Composite applications for WPF. Once we had the green light to go ahead, we had a tough decision to make, take CAB forward to WPF or start over. We chose to start over. 8 months later, we&amp;#39;ve incorporated tons of community &lt;a href="http://blogs.msdn.com/gblock/archive/2007/05/27/is-cab-complex-and-if-so-why.aspx"&gt;feedback&lt;/a&gt;, built a new set of &lt;a href="http://blogs.msdn.com/gblock/archive/2008/07/02/composite-application-guidance-what-is-it.aspx"&gt;guidance&lt;/a&gt; specifically for building Composite applications in WPF. As it goes out the door, we&amp;#39;re very happy we stuck to our guns on that decision. &lt;/p&gt;  &lt;h2&gt;The Team&lt;/h2&gt;  &lt;p&gt;We couldn&amp;#39;t have done it alone. In addition to a fantastic, and extremely focused &lt;a href="http://blogs.msdn.com/gblock/archive/2008/04/27/the-prism-team-and-how-we-develop.aspx"&gt;team&lt;/a&gt; including &lt;a href="http://briannoyes.net/"&gt;Brian Noyes&lt;/a&gt; from &lt;a href="http://idesign.net/"&gt;IDesign&lt;/a&gt;, &lt;a href="http://blogs.interknowlogy.com/adamcalderon/"&gt;Adam Calderon&lt;/a&gt; from &lt;a href="http://www.interknowlogy.com/"&gt;Interknowlogy&lt;/a&gt;, &lt;a href="http://www.southworks.net/"&gt;Southworks&lt;/a&gt; and &lt;a href="http://www.infosys.com/"&gt;Infosys&lt;/a&gt; we had a large set of advisors. Across Microsoft, we had help from several product teams including WPF (&lt;a href="http://blogs.msdn.com/henryh/"&gt;Henry Hahn&lt;/a&gt;,Ivo Manlov,&lt;a href="http://blogs.msdn.com/johngossman/"&gt;John Gossman&lt;/a&gt;,&lt;a href="http://blogs.msdn.com/mikehillberg/default.aspx"&gt;Mike Hillberg&lt;/a&gt;,&lt;a href="http://rrelyea.spaces.live.com/"&gt;Rob Relyea&lt;/a&gt;), UIFX (&lt;a href="http://blogs.msdn.com/brada/"&gt;Brad Abrams&lt;/a&gt; and &lt;a href="http://blogs.msdn.com/dphill/"&gt;David Hill&lt;/a&gt;), DPE (&lt;a href="http://blogs.msdn.com/jaimer/"&gt;Jaime Rodriguez&lt;/a&gt;, &lt;a href="http://blogs.msdn.com/karstenj/"&gt;Karsten Junszewski&lt;/a&gt;, &lt;a href="http://blogs.msdn.com/jbienz/"&gt;Jared Bienz&lt;/a&gt;, &lt;a href="http://blogs.msdn.com/markfe"&gt;Mark Feinholz&lt;/a&gt;), and App Dev Consulting&amp;#39;s &lt;a href="http://www.thejoyofcode.com/Josh.aspx"&gt;Josh Twist&lt;/a&gt;. Combine this with an amazing committed group of partners (Infragistics), industry experts and advisors including &lt;a href="http://www.rollthunder.com/"&gt;David Platt&lt;/a&gt;,&lt;a href="http://codebetter.com/blogs/jeremy.miller"&gt;Jeremy Miller&lt;/a&gt;, &lt;a href="http://weblogs.asp.net/israelio/"&gt;Ohad Israeli&lt;/a&gt;,&lt;a href="http://www.ayende.com/"&gt;Oren Eini&lt;/a&gt;, &lt;a href="http://devlicious.com/blogs/rob_eisenberg/default.aspx"&gt;Rob Eisenberg&lt;/a&gt;, &lt;a href="http://geekswithblogs.net/kobush"&gt;Szymon Kobalczyk&lt;/a&gt;,&lt;a href="http://udidahan.weblogs.us/"&gt;Udi Dahan&lt;/a&gt;, and &lt;a href="http://neverindoubtnet.blogspot.com/"&gt;Ward Bell&lt;/a&gt;. This is just a sampling, the full list is below&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Bil Simser, Brad Abrams (Microsoft Corporation), Chad Myers, David S Platt (Rolling Thunder Computing, Inc.), Derek Greer, Ian Ellison-Taylor (Microsoft Corporation), Ivo Manolov (Microsoft Corporation), Jamie Rodriguez (Microsoft Corporation), Jeremy D. Miller (Dovetail Software), Josh Twist (Microsoft Corporation), Matt Smith (AltiMotion Corporation), Mark Tucker (JDA Software Group, Inc.), Michael D. Brown (Software Engineering Professionals, Inc.), Michael Kenyon (IHS, Inc.), Michael Sparks (RDA Corp), Ohad Israeli (Hewlett-Packard), Oren Eini (aka Ayende Rahien), Peter Lindes (The Church of Jesus Christ of Latter-day Saints), Rob Eisenberg (Blue Spire Consulting, Inc.), Shanku Niyogi (Microsoft Corporation), Scott Bellware, Szymon Kobalczyk (InterKnowlogy), Udi Dahan (The Software Simplist), Varghese John (UBS), Ward Bell (IdeaBlade)&lt;/strong&gt;&lt;/p&gt;  &lt;h2&gt;Final thoughts&lt;/h2&gt;  &lt;p&gt;For me, this has been an incredible journey. I&amp;#39;ve had the pleasure of working with the most talented individuals inside and outside of Microsoft than I have to date. It just doesn&amp;#39;t get any better than this! Thank you to everyone who has made this possible!&lt;/p&gt;  &lt;p&gt;As Soma likes to say &lt;strong&gt;Namaste! &lt;/strong&gt;&lt;/p&gt;&lt;img src="http://codebetter.com/aggbug.aspx?PostID=180279" width="1" height="1"&gt;</description><category domain="http://codebetter.com/blogs/glenn.block/archive/tags/Composite+Application+Guidance/default.aspx">Composite Application Guidance</category><category domain="http://codebetter.com/blogs/glenn.block/archive/tags/Composite+Application+Library/default.aspx">Composite Application Library</category><category domain="http://codebetter.com/blogs/glenn.block/archive/tags/Composite+WPF/default.aspx">Composite WPF</category></item><item><title>Composite Application Guidance - What is it?</title><link>http://codebetter.com/blogs/glenn.block/archive/2008/07/01/composite-application-guidance-what-is-it.aspx</link><pubDate>Wed, 02 Jul 2008 00:22:15 GMT</pubDate><guid isPermaLink="false">d21fbbc9-c112-4f32-ad14-95939a2c53d4:180192</guid><dc:creator>Glenn Block</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://codebetter.com/blogs/glenn.block/rsscomments.aspx?PostID=180192</wfw:commentRss><comments>http://codebetter.com/blogs/glenn.block/archive/2008/07/01/composite-application-guidance-what-is-it.aspx#comments</comments><description>&lt;p&gt;In the development of the Composite Application Guidance one area that we have labored intensely was around documentation. Documentation was so high on our priority list, that we deliberately reduced the number of bells and whistles in order to allow us to properly document what we had. As part of this we put in a &lt;em&gt;significant &lt;/em&gt;effort to provide overview level information. We heard a lot of feedback from customers on the need for us to provide much more of the &amp;quot;Why&amp;quot; rather than the &amp;quot;What&amp;quot;. Our hope when you see the documentation is that you feel we have provided enough background to understand what the guidance is and what problems it is solving. We equally want you to understand why we did what we did, how it benefits you, and when you should consider discarding out particular implementation.&lt;/p&gt;  &lt;p&gt;Below is our overview topic on the guidance pulled straight from out docs. (Forgive the crappy formatting, I tried :) ) &lt;/p&gt;  &lt;div style="border-right:medium none;padding-right:0in;border-top:medium none;padding-left:0in;padding-bottom:4pt;border-left:medium none;padding-top:0in;border-bottom:#4f81bd 1pt solid;mso-element:para-border-div;mso-border-bottom-themecolor:accent1;"&gt;&amp;#160;&lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p class="ppBodyText" style="margin-left:0in;text-indent:0in;"&gt;The goal of this topic is to provide you with a high-level overview of the Microsoft patterns &amp;amp; practices Composite Application Guidance for WPF (Windows Presentation Foundation) and the development challenges it addresses.&lt;/p&gt;  &lt;p class="ppBodyText" style="margin-left:0in;text-indent:0in;"&gt;&lt;a name="AWhatisPrism"&gt;&lt;/a&gt;This topic describes some of the problems you might encounter when building complex WPF client applications, how the Composite Application Guidance helps you to address those problems, and how the Composite Application Guidance compares to alternative approaches.&lt;/p&gt;  &lt;h2&gt;Application Development Challenges&lt;/h2&gt;  &lt;p class="ppBodyText" style="margin-left:0in;text-indent:0in;"&gt;Typically, developers of client applications face a number of challenges. Most enterprise applications are sufficiently complex that they require more than one developer, maybe even a large team of developers that includes user interface (UI) designers and localizers in addition to developers. It can be a significant challenge to decide how to design the application so that multiple developers or sub-teams can work effectively on different pieces of the application independently, yet ensuring that the pieces come together seamlessly when integrated into the application.&lt;/p&gt;  &lt;p class="ppBodyText" style="margin-left:0in;text-indent:0in;"&gt;In addition, application requirements can change over time. New business opportunities and challenges may present themselves, new technologies may become available, or even ongoing customer feedback during the development cycle may significantly affect the requirements of the application. Therefore, it is important to build the application so that it is flexible and can be easily modified or extended over time. Designing for maintainability can be hard to accomplish. It requires an architecture that allows individual parts of the application to be independently developed and tested and that can be modified or updated later, in isolation, without affecting the rest of the application.&lt;/p&gt;  &lt;p class="ppBodyText" style="margin-left:0in;text-indent:0in;"&gt;Designing and building applications in a &lt;i style="mso-bidi-font-style:normal;"&gt;monolithic&lt;/i&gt; style can lead to an application that is very difficult and inefficient to maintain. In this case, &amp;quot;monolithic&amp;quot; refers to an application in which the components are very tightly coupled and there is no clear separation between them. Typically, applications designed and built this way suffer from a number of problems that make the developer&amp;#39;s life hard. It is difficult to add new features to the system or replace existing features, it is difficult to resolve bugs without breaking other portions of the system, and it is difficult to test and deploy. Also, it impacts the ability of developers and designers to work efficiently together.&lt;/p&gt;  &lt;h2&gt;The &lt;a name="CProblem"&gt;&lt;/a&gt;&lt;a name="CCompositeUIApps"&gt;&lt;/a&gt;Composite Approach&lt;/h2&gt;  &lt;p class="ppBodyText" style="margin-left:0in;text-indent:0in;"&gt;An effective remedy for these challenges is to partition the application into a number of discrete, loosely coupled, semi-independent components that can then be easily integrated together into an application &amp;quot;shell&amp;quot; to form a coherent solution. Applications designed and built this way are named composite applications.&lt;/p&gt;  &lt;p class="ppBodyText" style="margin-left:0in;text-indent:0in;"&gt;Composite applications provide many benefits, including the following:&lt;/p&gt;  &lt;p class="ppBulletList"&gt;&lt;span style="font-family:symbol;mso-fareast-font-family:symbol;mso-bidi-font-family:symbol;"&gt;&lt;span style="mso-list:ignore;"&gt;&amp;#183;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;They allow modules to be individually developed, tested, and deployed by different individuals or sub-teams, allows them to be modified or extended with new functionality more easily, thereby allowing the application to be more easily extended and maintained.&lt;/p&gt;  &lt;p class="ppBulletList"&gt;&lt;span style="font-family:symbol;mso-fareast-font-family:symbol;mso-bidi-font-family:symbol;"&gt;&lt;span style="mso-list:ignore;"&gt;&amp;#183;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;They provide a common shell composed of UI components contributed from various modules that interact in a loosely coupled fashion. This reduces the contention that arises from multiple developers adding new functionality to the UI, and it promotes a common look and feel. &lt;/p&gt;  &lt;p class="ppBulletList"&gt;&lt;span style="font-family:symbol;mso-fareast-font-family:symbol;mso-bidi-font-family:symbol;"&gt;&lt;span style="mso-list:ignore;"&gt;&amp;#183;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;They promote re-use and a clean separation of concerns between the application&amp;#39;s horizontal capabilities, such as logging and authentication, and the vertical capabilities, such as business functionality that is specific to your application.&lt;/p&gt;  &lt;p class="ppBulletList"&gt;&lt;span style="font-family:symbol;mso-fareast-font-family:symbol;mso-bidi-font-family:symbol;"&gt;&lt;span style="mso-list:ignore;"&gt;&amp;#183;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;They help maintain a separation of roles by allowing different individuals or sub-teams to focus on a specific task or piece of functionality according to their focus or expertise. In particular, it provides a cleaner separation between the user interface and the business logic of the application&amp;#8212;this means the UI designer can focus on creating a richer user experience.&lt;/p&gt;  &lt;div style="border-right:medium none;padding-right:0in;border-top:silver 1pt solid;padding-left:0in;padding-bottom:0in;margin-left:8.65pt;border-left:medium none;margin-right:3in;padding-top:1pt;border-bottom:medium none;mso-element:para-border-div;mso-border-top-alt:solid silver .25pt;"&gt;   &lt;p class="ppListEnd" style="margin:0in 0in 6pt;text-indent:0in;"&gt;&lt;/p&gt;    &lt;p&gt;&amp;#160;&lt;/p&gt;    &lt;p&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p class="ppBodyText" style="margin-left:0in;text-indent:0in;"&gt;Composite applications are highly suited to a range of client application scenarios. For example, a composite application is ideal for creating a rich end-user experience over a number of disparate back-end systems. Figure 1 shows an example of this type of a composite application.&lt;/p&gt;  &lt;p class="ppBodyText" style="margin-left:0in;text-indent:0in;"&gt;&lt;a href="http://codebetter.com/blogs/glenn.block/WindowsLiveWriter/CompositeApplicationGuidanceWhatisit_F39E/image_4.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="452" alt="image" src="http://codebetter.com/blogs/glenn.block/WindowsLiveWriter/CompositeApplicationGuidanceWhatisit_F39E/image_thumb_1.png" width="541" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p class="ppFigure" style="margin-left:0in;text-indent:0in;"&gt;&lt;span style="mso-bidi-language:ar-sa;mso-no-proof:yes;"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="ppFigureNumber" style="margin-left:0in;text-indent:0in;"&gt;&lt;a name="_Ref185156068"&gt;Figure 1&lt;/a&gt;&lt;/p&gt;  &lt;p class="ppFigureCaption" style="margin-left:0in;text-indent:0in;"&gt;Composite application with multiple back-end systems&lt;/p&gt;  &lt;p class="ppBodyText" style="mso-list:none;"&gt;In this type of application, the user can be presented with a rich and flexible user experience that provides a task-oriented focus over functionality that spans multiple back-end systems, services, and data stores, where each is represented by one or more dedicated modules. The clean separation between the application logic and the user interface allows the application to provide a consistent and differentiated look and feel across all constituent modules.&lt;/p&gt;  &lt;p class="ppBodyText" style="margin-left:0in;text-indent:0in;"&gt;Additionally, a composite application can be useful when there are independently evolving components in the UI that heavily integrate with each other and that are often maintained by separate teams. Figure 2 shows a screen shot of this type of application. Each of the areas highlighted represent independent components that are composed into the UI.&lt;/p&gt;  &lt;p class="ppBodyText" style="margin-left:0in;text-indent:0in;"&gt;&lt;a href="http://codebetter.com/blogs/glenn.block/WindowsLiveWriter/CompositeApplicationGuidanceWhatisit_F39E/image_6.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="379" alt="image" src="http://codebetter.com/blogs/glenn.block/WindowsLiveWriter/CompositeApplicationGuidanceWhatisit_F39E/image_thumb_2.png" width="637" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p class="ppFigure" style="margin-left:0in;text-indent:0in;"&gt;&lt;span style="mso-bidi-language:ar-sa;mso-no-proof:yes;"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="ppFigureNumber" style="margin-left:0in;text-indent:0in;"&gt;&lt;a name="_Ref202220809"&gt;Figure 2&lt;/a&gt;&lt;/p&gt;  &lt;p class="ppFigureCaption" style="margin-left:0in;text-indent:0in;"&gt;Stock Trader Reference Implementation composite application&lt;/p&gt;  &lt;p class="ppBodyText" style="margin-left:0in;text-indent:0in;"&gt;In this case, the composite allows the application&amp;#39;s user interface to be dynamic composed. This delivers a flexible user experience. For example, it can allow new functionality to be dynamically added to the application at run time, which enables rich end-user customization and extensibility.&lt;/p&gt;  &lt;h2&gt;Architectural Goals and Principles&lt;/h2&gt;  &lt;p class="ppBodyText" style="margin-left:0in;text-indent:0in;"&gt;The following table shows the architectural principles that have been prioritized by the Composite Application Guidance team&amp;#39;s customer advisory board. These principles determine how guidance is developed and what the focus areas are.&lt;/p&gt;  &lt;table class="ppTableGrid" style="border-right:medium none;border-top:medium none;border-left:medium none;width:100%;border-bottom:medium none;border-collapse:collapse;mso-border-alt:solid #999999 1.5pt;mso-yfti-tbllook:1184;mso-padding-alt:0in 5.4pt 0in 5.4pt;" cellspacing="0" cellpadding="0"&gt;     &lt;tr style="mso-yfti-irow:-1;mso-yfti-firstrow:yes;"&gt;       &lt;td style="border-right:#999999 1.5pt solid;padding-right:5.4pt;border-top:#999999 1.5pt solid;padding-left:5.4pt;background:#e6e6e6;padding-bottom:0in;border-left:#999999 1.5pt solid;width:16.16%;padding-top:0in;border-bottom:medium none;"&gt;         &lt;p class="ppTableText" style="mso-yfti-cnfc:1;"&gt;&lt;b style="mso-bidi-font-weight:normal;"&gt;Quality &lt;/b&gt;            &lt;p&gt;&lt;/p&gt;         &lt;/p&gt;          &lt;p&gt;&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-right:#999999 1.5pt solid;padding-right:5.4pt;border-top:#999999 1.5pt solid;padding-left:5.4pt;background:#e6e6e6;padding-bottom:0in;border-left:medium none;width:83.84%;padding-top:0in;border-bottom:medium none;mso-border-left-alt:solid #999999 1.5pt;"&gt;         &lt;p class="ppTableText" style="mso-yfti-cnfc:1;"&gt;&lt;b style="mso-bidi-font-weight:normal;"&gt;Definition &lt;/b&gt;            &lt;p&gt;&lt;/p&gt;         &lt;/p&gt;          &lt;p&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr style="mso-yfti-irow:0;"&gt;       &lt;td style="border-right:#999999 1.5pt solid;padding-right:5.4pt;border-top:#999999 1.5pt solid;padding-left:5.4pt;padding-bottom:0in;border-left:#999999 1.5pt solid;width:16.16%;padding-top:0in;border-bottom:#999999 1.5pt solid;"&gt;         &lt;p class="ppTableText"&gt;Subsetability&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-right:#999999 1.5pt solid;padding-right:5.4pt;border-top:#999999 1.5pt solid;padding-left:5.4pt;padding-bottom:0in;border-left:medium none;width:83.84%;padding-top:0in;border-bottom:#999999 1.5pt solid;mso-border-left-alt:solid #999999 1.5pt;"&gt;         &lt;p class="ppTableText"&gt;This is the ability to adopt a portion of the Composite Application Library. You can choose only certain capabilities, incrementally adopt capabilities, and enable or disable features.&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr style="mso-yfti-irow:1;"&gt;       &lt;td style="border-right:#999999 1.5pt solid;padding-right:5.4pt;border-top:medium none;padding-left:5.4pt;padding-bottom:0in;border-left:#999999 1.5pt solid;width:16.16%;padding-top:0in;border-bottom:#999999 1.5pt solid;mso-border-top-alt:solid #999999 1.5pt;"&gt;         &lt;p class="ppTableText"&gt;Learnability&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-right:#999999 1.5pt solid;padding-right:5.4pt;border-top:medium none;padding-left:5.4pt;padding-bottom:0in;border-left:medium none;width:83.84%;padding-top:0in;border-bottom:#999999 1.5pt solid;mso-border-top-alt:solid #999999 1.5pt;mso-border-left-alt:solid #999999 1.5pt;"&gt;         &lt;p class="ppTableText"&gt;This is the ability to quickly learn how to build WPF composite applications using the Composite Application Library. With small digestible and independent capabilities, you get started faster.&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr style="mso-yfti-irow:2;"&gt;       &lt;td style="border-right:#999999 1.5pt solid;padding-right:5.4pt;border-top:medium none;padding-left:5.4pt;padding-bottom:0in;border-left:#999999 1.5pt solid;width:16.16%;padding-top:0in;border-bottom:#999999 1.5pt solid;mso-border-top-alt:solid #999999 1.5pt;"&gt;         &lt;p class="ppTableText"&gt;Extensibility&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-right:#999999 1.5pt solid;padding-right:5.4pt;border-top:medium none;padding-left:5.4pt;padding-bottom:0in;border-left:medium none;width:83.84%;padding-top:0in;border-bottom:#999999 1.5pt solid;mso-border-top-alt:solid #999999 1.5pt;mso-border-left-alt:solid #999999 1.5pt;"&gt;         &lt;p class="ppTableText"&gt;This is the ability to enhance, extend, or replace pieces of the framework without requiring you to redesign the framework or your application. &lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr style="mso-yfti-irow:3;"&gt;       &lt;td style="border-right:#999999 1.5pt solid;padding-right:5.4pt;border-top:medium none;padding-left:5.4pt;padding-bottom:0in;border-left:#999999 1.5pt solid;width:16.16%;padding-top:0in;border-bottom:#999999 1.5pt solid;mso-border-top-alt:solid #999999 1.5pt;"&gt;         &lt;p class="ppTableText"&gt;Compatibility&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-right:#999999 1.5pt solid;padding-right:5.4pt;border-top:medium none;padding-left:5.4pt;padding-bottom:0in;border-left:medium none;width:83.84%;padding-top:0in;border-bottom:#999999 1.5pt solid;mso-border-top-alt:solid #999999 1.5pt;mso-border-left-alt:solid #999999 1.5pt;"&gt;         &lt;p class="ppTableText"&gt;This means you can adopt the Composite Application Library for an existing application and you can use it with other existing infrastructure. Core services are swappable.&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr style="mso-yfti-irow:4;"&gt;       &lt;td style="border-right:#999999 1.5pt solid;padding-right:5.4pt;border-top:medium none;padding-left:5.4pt;padding-bottom:0in;border-left:#999999 1.5pt solid;width:16.16%;padding-top:0in;border-bottom:#999999 1.5pt solid;mso-border-top-alt:solid #999999 1.5pt;"&gt;         &lt;p class="ppTableText"&gt;Simplicity&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-right:#999999 1.5pt solid;padding-right:5.4pt;border-top:medium none;padding-left:5.4pt;padding-bottom:0in;border-left:medium none;width:83.84%;padding-top:0in;border-bottom:#999999 1.5pt solid;mso-border-top-alt:solid #999999 1.5pt;mso-border-left-alt:solid #999999 1.5pt;"&gt;         &lt;p class="ppTableText"&gt;This means the Composite Application Library is designed in a minimalist way to reduce the amount of complexity. The Composite Application Library has just enough simplicity to get the job done.&lt;sub&gt; &lt;/sub&gt;            &lt;p&gt;&lt;/p&gt;         &lt;/p&gt;          &lt;p&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr style="mso-yfti-irow:5;"&gt;       &lt;td style="border-right:#999999 1.5pt solid;padding-right:5.4pt;border-top:medium none;padding-left:5.4pt;padding-bottom:0in;border-left:#999999 1.5pt solid;width:16.16%;padding-top:0in;border-bottom:#999999 1.5pt solid;mso-border-top-alt:solid #999999 1.5pt;"&gt;         &lt;p class="ppTableText"&gt;Testability&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-right:#999999 1.5pt solid;padding-right:5.4pt;border-top:medium none;padding-left:5.4pt;padding-bottom:0in;border-left:medium none;width:83.84%;padding-top:0in;border-bottom:#999999 1.5pt solid;mso-border-top-alt:solid #999999 1.5pt;mso-border-left-alt:solid #999999 1.5pt;"&gt;         &lt;p class="ppTableText"&gt;The reference implementation in the Composite Application Guidance provides an implementation for Separated Presentation patterns. These patterns allow UI logic to be tested.&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr style="mso-yfti-irow:6;"&gt;       &lt;td style="border-right:#999999 1.5pt solid;padding-right:5.4pt;border-top:medium none;padding-left:5.4pt;padding-bottom:0in;border-left:#999999 1.5pt solid;width:16.16%;padding-top:0in;border-bottom:#999999 1.5pt solid;mso-border-top-alt:solid #999999 1.5pt;"&gt;         &lt;p class="ppTableText"&gt;Performance&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-right:#999999 1.5pt solid;padding-right:5.4pt;border-top:medium none;padding-left:5.4pt;padding-bottom:0in;border-left:medium none;width:83.84%;padding-top:0in;border-bottom:#999999 1.5pt solid;mso-border-top-alt:solid #999999 1.5pt;mso-border-left-alt:solid #999999 1.5pt;"&gt;         &lt;p class="ppTableText"&gt;The Composite Application Library minimizes overhead while the application is running.&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr style="mso-yfti-irow:7;"&gt;       &lt;td style="border-right:#999999 1.5pt solid;padding-right:5.4pt;border-top:medium none;padding-left:5.4pt;padding-bottom:0in;border-left:#999999 1.5pt solid;width:16.16%;padding-top:0in;border-bottom:#999999 1.5pt solid;mso-border-top-alt:solid #999999 1.5pt;"&gt;         &lt;p class="ppTableText"&gt;Scalability&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-right:#999999 1.5pt solid;padding-right:5.4pt;border-top:medium none;padding-left:5.4pt;padding-bottom:0in;border-left:medium none;width:83.84%;padding-top:0in;border-bottom:#999999 1.5pt solid;mso-border-top-alt:solid #999999 1.5pt;mso-border-left-alt:solid #999999 1.5pt;"&gt;         &lt;p class="ppTableText"&gt;The application can scale to support increased load.&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr style="mso-yfti-irow:8;mso-yfti-lastrow:yes;"&gt;       &lt;td style="border-right:#999999 1.5pt solid;padding-right:5.4pt;border-top:medium none;padding-left:5.4pt;padding-bottom:0in;border-left:#999999 1.5pt solid;width:16.16%;padding-top:0in;border-bottom:#999999 1.5pt solid;mso-border-top-alt:solid #999999 1.5pt;"&gt;         &lt;p class="ppTableText"&gt;Upgradeability&lt;/p&gt;       &lt;/td&gt;        &lt;td style="border-right:#999999 1.5pt solid;padding-right:5.4pt;border-top:medium none;padding-left:5.4pt;padding-bottom:0in;border-left:medium none;width:83.84%;padding-top:0in;border-bottom:#999999 1.5pt solid;mso-border-top-alt:solid #999999 1.5pt;mso-border-left-alt:solid #999999 1.5pt;"&gt;         &lt;p class="ppTableText"&gt;Existing WPF applications can be upgraded to use the Composite Application Library.&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/table&gt;  &lt;h2&gt;Adoption Experience&lt;/h2&gt;  &lt;p class="ppBodyText" style="margin-left:0in;text-indent:0in;"&gt;The Composite Application Guidance has an explicit goal to provide a good adoption experience. To deliver on this goal, the Composite Application Guidance provides the following:&lt;/p&gt;  &lt;p class="ppBulletList"&gt;&lt;span style="font-family:symbol;mso-fareast-font-family:symbol;mso-bidi-font-family:symbol;"&gt;&lt;span style="mso-list:ignore;"&gt;&amp;#183;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;You can &amp;quot;opt in&amp;quot; and &amp;quot;opt out&amp;quot; of the Composite Application Library capabilities. For example, you can consume the only services you need.&lt;/p&gt;  &lt;p class="ppBulletList"&gt;&lt;span style="font-family:symbol;mso-fareast-font-family:symbol;mso-bidi-font-family:symbol;"&gt;&lt;span style="mso-list:ignore;"&gt;&amp;#183;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;You can incrementally add the Composite Application Library capabilities to your existing WPF applications.&lt;/p&gt;  &lt;p class="ppBulletList"&gt;&lt;span style="font-family:symbol;mso-fareast-font-family:symbol;mso-bidi-font-family:symbol;"&gt;&lt;span style="mso-list:ignore;"&gt;&amp;#183;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;It is non-invasive because of the following:&lt;/p&gt;  &lt;p class="ppBulletListIndent" style="tab-stops:list 87.85pt;"&gt;&lt;span style="font-family:;"&gt;&lt;span style="mso-list:ignore;"&gt;◦&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;It limits the Composite Application Library footprint in the code. &lt;/p&gt;  &lt;p class="ppBulletListIndent" style="tab-stops:list 87.85pt;"&gt;&lt;span style="font-family:;"&gt;&lt;span style="mso-list:ignore;"&gt;◦&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;It limits reliance on custom Composite Application Library attributes. You can integrate existing libraries with the Composite Application Library through a design that favors composition over inheritance (this avoids forcing you to inherit from the classes in the Composite Application Library).&lt;/p&gt;  &lt;p class="ppListEnd" style="margin:0in 0in 6pt;text-indent:0in;"&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;Concerns Not Addressed by the Composite Application Guidance&lt;/h2&gt;  &lt;p class="ppBodyText" style="margin-left:0in;text-indent:0in;"&gt;&lt;span style="mso-bidi-language:ar-sa;"&gt;Please note that the Composite Application Guidance does not directly address the following: &lt;/span&gt;    &lt;p&gt;&lt;/p&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p class="ppBulletList"&gt;&lt;span style="font-family:symbol;mso-fareast-font-family:symbol;mso-bidi-font-family:symbol;"&gt;&lt;span style="mso-list:ignore;"&gt;&amp;#183;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Occasional connectivity&lt;/p&gt;  &lt;p class="ppBulletList"&gt;&lt;span style="font-family:symbol;mso-fareast-font-family:symbol;mso-bidi-font-family:symbol;"&gt;&lt;span style="mso-list:ignore;"&gt;&amp;#183;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Messaging infrastructure, including the following:&lt;/p&gt;  &lt;p class="ppBulletListIndent" style="tab-stops:list 87.85pt;"&gt;&lt;span style="font-family:;"&gt;&lt;span style="mso-list:ignore;"&gt;◦&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Client/server communication&lt;/p&gt;  &lt;p class="ppBulletListIndent" style="tab-stops:list 87.85pt;"&gt;&lt;span style="font-family:;"&gt;&lt;span style="mso-list:ignore;"&gt;◦&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Asynchronous communication&lt;/p&gt;  &lt;p class="ppBulletListIndent" style="tab-stops:list 87.85pt;"&gt;&lt;span style="font-family:;"&gt;&lt;span style="mso-list:ignore;"&gt;◦&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Encryption &lt;/p&gt;  &lt;p class="ppBulletList"&gt;&lt;span style="font-family:symbol;mso-fareast-font-family:symbol;mso-bidi-font-family:symbol;"&gt;&lt;span style="mso-list:ignore;"&gt;&amp;#183;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Application performance&lt;/p&gt;  &lt;p class="ppBulletList"&gt;&lt;span style="font-family:symbol;mso-fareast-font-family:symbol;mso-bidi-font-family:symbol;"&gt;&lt;span style="mso-list:ignore;"&gt;&amp;#183;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Authentication and authorization&lt;/p&gt;  &lt;p class="ppBulletList"&gt;&lt;span style="font-family:symbol;mso-fareast-font-family:symbol;mso-bidi-font-family:symbol;"&gt;&lt;span style="mso-list:ignore;"&gt;&amp;#183;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Handling thread-safety from background updates, including the following:&lt;/p&gt;  &lt;p class="ppBulletListIndent" style="tab-stops:list 87.85pt;"&gt;&lt;span style="font-family:;"&gt;&lt;span style="mso-list:ignore;"&gt;◦&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Data races&lt;/p&gt;  &lt;p class="ppBulletListIndent" style="tab-stops:list 87.85pt;"&gt;&lt;span style="font-family:;"&gt;&lt;span style="mso-list:ignore;"&gt;◦&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Data synchronization&lt;/p&gt;  &lt;p class="ppBulletListIndent" style="tab-stops:list 87.85pt;"&gt;&lt;span style="font-family:;"&gt;&lt;span style="mso-list:ignore;"&gt;◦&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Handling UI updates from multiple threads (the Composite Application Library addresses some aspects of this)&lt;/p&gt;  &lt;p class="ppBulletList"&gt;&lt;span style="font-family:symbol;mso-fareast-font-family:symbol;mso-bidi-font-family:symbol;"&gt;&lt;span style="mso-list:ignore;"&gt;&amp;#183;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Versioning&lt;/p&gt;  &lt;p class="ppBulletList"&gt;&lt;span style="font-family:symbol;mso-fareast-font-family:symbol;mso-bidi-font-family:symbol;"&gt;&lt;span style="mso-list:ignore;"&gt;&amp;#183;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Error handling and fault tolerance&lt;/p&gt;  &lt;p class="ppListEnd" style="margin:0in 0in 6pt;text-indent:0in;"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="ppBodyText" style="margin-left:0in;text-indent:0in;"&gt;For more information about these topics, see the following resources:&lt;/p&gt;  &lt;p class="ppBulletList"&gt;&lt;span style="font-family:symbol;mso-fareast-font-family:symbol;mso-bidi-font-family:symbol;"&gt;&lt;span style="mso-list:ignore;"&gt;&amp;#183;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms998506.aspx"&gt;Smart Client Architecture and Design Guide&lt;/a&gt;&lt;span style="color:#333333;"&gt; &lt;/span&gt;    &lt;p&gt;&lt;/p&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p class="ppBulletList"&gt;&lt;span style="font-family:symbol;mso-fareast-font-family:symbol;mso-bidi-font-family:symbol;"&gt;&lt;span style="mso-list:ignore;"&gt;&amp;#183;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href="http://www.developer.com/design/article.php/3708006"&gt;&lt;span style="mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;Occasionally Connected Systems Architecture: The Client&lt;/span&gt;&lt;/a&gt;&lt;span style="color:#333333;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt; &lt;/span&gt;    &lt;p&gt;&lt;/p&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p class="ppBulletList"&gt;&lt;span style="font-family:symbol;mso-fareast-font-family:symbol;mso-bidi-font-family:symbol;"&gt;&lt;span style="mso-list:ignore;"&gt;&amp;#183;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href="http://www.developer.com/design/article.php/3705396"&gt;&lt;span style="mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;Occasionally Connected Systems Architecture: Concurrency&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p class="ppListEnd" style="margin:0in 0in 6pt;text-indent:0in;"&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;Considerations for Choosing the Composite Application Guidance&lt;/h2&gt;  &lt;p class="ppBodyText" style="margin-left:0in;text-indent:0in;"&gt;The Composite Application Guidance is for designing complex WPF applications. The scenarios where you should consider using the Composite Application Guidance include the following:&lt;/p&gt;  &lt;p class="ppBulletList"&gt;&lt;span style="font-family:symbol;mso-fareast-font-family:symbol;mso-bidi-font-family:symbol;"&gt;&lt;span style="mso-list:ignore;"&gt;&amp;#183;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;You are building a composite application that presents information from multiple sources through an integrated user interface.&lt;/p&gt;  &lt;p class="ppBulletList"&gt;&lt;span style="font-family:symbol;mso-fareast-font-family:symbol;mso-bidi-font-family:symbol;"&gt;&lt;span style="mso-list:ignore;"&gt;&amp;#183;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;You are developing, testing, and deploying modules independently of the other modules.&lt;/p&gt;  &lt;p class="ppBulletList"&gt;&lt;span style="font-family:symbol;mso-fareast-font-family:symbol;mso-bidi-font-family:symbol;"&gt;&lt;span style="mso-list:ignore;"&gt;&amp;#183;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Your application is being developed by multiple collaborating teams.&lt;/p&gt;  &lt;p class="ppBodyText" style="margin-left:0in;text-indent:0in;"&gt;If your applications do not require one or more of these scenarios, the Composite Application Guidance may not be right for you. The Composite Application Guidance requires you to have hands-on experience with WPF. If you need general information about WPF, see the following sources:&lt;/p&gt;  &lt;p class="ppBulletList"&gt;&lt;span style="font-family:symbol;mso-fareast-font-family:symbol;mso-bidi-font-family:symbol;"&gt;&lt;span style="mso-list:ignore;"&gt;&amp;#183;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/ms754130.aspx"&gt;Windows Presentation Foundation&lt;/a&gt; on MSDN&lt;/p&gt;  &lt;p class="ppBulletList"&gt;&lt;span style="font-family:symbol;mso-fareast-font-family:symbol;mso-bidi-font-family:symbol;"&gt;&lt;span style="mso-list:ignore;"&gt;&amp;#183;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Sells, Chris and Ian Griffiths. &lt;i&gt;Programming WPF: Building Windows UI with Windows Presentation Foundation&lt;/i&gt;. Second Edition. O&amp;#8217;Reilly Media, Inc., 2007. &lt;/p&gt;  &lt;p class="ppBulletList"&gt;&lt;span style="font-family:symbol;mso-fareast-font-family:symbol;mso-bidi-font-family:symbol;"&gt;&lt;span style="mso-list:ignore;"&gt;&amp;#183;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Nathan, Adam. &lt;i&gt;Windows Presentation Foundation Unleashed&lt;/i&gt;. Indianapolis, IN: Sams Publishing, 2006.&lt;/p&gt;&lt;img src="http://codebetter.com/aggbug.aspx?PostID=180192" width="1" height="1"&gt;</description><category domain="http://codebetter.com/blogs/glenn.block/archive/tags/Composite+Application+Guidance/default.aspx">Composite Application Guidance</category><category domain="http://codebetter.com/blogs/glenn.block/archive/tags/Composite+WPF/default.aspx">Composite WPF</category><category domain="http://codebetter.com/blogs/glenn.block/archive/tags/prism/default.aspx">prism</category></item><item><title>How Prism supports using multiple IOC containers</title><link>http://codebetter.com/blogs/glenn.block/archive/2008/07/01/how-prism-supports-using-multiple-ioc-containers.aspx</link><pubDate>Tue, 01 Jul 2008 18:50:54 GMT</pubDate><guid isPermaLink="false">d21fbbc9-c112-4f32-ad14-95939a2c53d4:180169</guid><dc:creator>Glenn Block</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://codebetter.com/blogs/glenn.block/rsscomments.aspx?PostID=180169</wfw:commentRss><comments>http://codebetter.com/blogs/glenn.block/archive/2008/07/01/how-prism-supports-using-multiple-ioc-containers.aspx#comments</comments><description>&lt;p&gt;Today we received the following question / comment on our forums around our strategy for supporting multiple containers in Prism. This is something that I believe is on the minds of other folks using Prism. Below is a portion of the thread which you can access &lt;a href="http://www.codeplex.com/CompositeWPF/Thread/View.aspx?ThreadId=30567"&gt;here&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#008000"&gt;Hi all,&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#008000"&gt;I&amp;#39;m currently getting up to speed with the Composite WPF project and looking to replace Unity with another DI framework (namely Ninject). Initially I had thought that it would just be a matter of duplicating some of the classes in the UnityExtensions project, ie the Bootstrapper and the ContainerAdapter. Indeed this works fine for an example as simple as HelloWorld and things are up and running in no time.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#008000"&gt;However, when I try to modify StockTraderRI, I notice that the IUnityContainer is being passed around quite a bit - most modules require a reference to it and so do some controllers. For the cases where it&amp;#39;s being used to resolve types in the controller and modules, it&amp;#39;s acting more as a Service Locator and it feels to me that it would be cleaner to have these dependencies injected instead of explicitly requiring the DI container to resolve them (OrdersController for example). Now this is fairly easy to f