<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Notes From the Team Room</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/bobbrum/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/bobbrum/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 03:19:23 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>patterns &amp; practices is hiring!</title>
      <link>https://docs.microsoft.com/archive/blogs/bobbrum/patterns-practices-is-hiring</link>
      <pubDate>Mon, 11 Jun 2012 11:16:00 GMT</pubDate>
      <dc:creator><![CDATA[brumfb1]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bobbrum/2012/06/11/patterns-practices-is-hiring/</guid>
      <description><![CDATA[I have an opening on the patterns &amp; practices team for a developer.  patterns &amp; practices...]]></description>
      <content:encoded><![CDATA[<p>I have an opening on the patterns &amp; practices team for a developer.</p>  <p>patterns &amp; practices works towards helping those developing on the Microsoft platforms more successful.&#160; <a href="https://msdn.microsoft.com/en-us/practices/bb190351">We produce</a> books, reference implements, and libraries that help people in developing web, client, and mobile applications.&#160; You can find out more what p&amp;p does and how we do on <a href="https://msdn.microsoft.com/en-us/practices/bb969103">our dev center</a>.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/13/17/metablogapi/8666.pp-Team-Room_4C3230AF.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-13-17-metablogapi/8666.pp_2D00_Team_2D00_Room_5F00_4C3230AF.jpg"><img title="p&amp;p Team Room" border="0" alt="p&amp;p Team Room" align="left" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/13/17/metablogapi/2818.pp-Team-Room_thumb_673AD9F0.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-13-17-metablogapi/2818.pp_2D00_Team_2D00_Room_5F00_thumb_5F00_673AD9F0.jpg" width="177" height="134" /></a>As a p&amp;p developer you will have the opportunity to work on a number of projects throughout the year.&#160; Our projects run between two and six months in length and focus on the latest Microsoft (and related) technology stacks:&#160; ASP.Net MVC, HTML5, Javascript, Azure, Windows 8, Windows Phone 7, and WPF.&#160; You will work with other talented developers, program managers, testers, and writers in an agile process to help customers better understand how to solve specific challenges and help communicate those solutions.</p>  <p>You will get opportunities to meet and talk with customers most weeks, as well as presenting at our yearly <a href="https://msdn.microsoft.com/en-us/practices/dd578307.aspx">p&amp;p symposium</a> and other conferences.&#160; Developers also typically blog, deliver podcasts, and engage in discussions with our customers on our Codeplex forums.</p>  <p><strong>If you were at p&amp;p this year you could have worked on:</strong></p>  <p><a href="https://liike.github.com/">Building modern mobile web apps</a> – Building great mobile experiences based on device capabilities and feature detection.</p>  <p><a href="https://msdn.microsoft.com/en-us/library/hh680918(v=pandp.50).aspx">Wasabi and Topaz – Enterprise Library 5.0 Integration Pack for Windows Azure</a> – Creating highly resilient and scalable Windows Azure applications with auto-scaling and transient fault handling.</p>  <p><font color="#333333"><a href="https://msdn.microsoft.com/en-us/practices/bb232643">Developing an Advanced Windows Phone 7.5 App that Connects to the Cloud</a> – Building a Windows Phone 7.5 that integrates with Windows Azure-based services.</font></p>  <p><a href="https://msdn.microsoft.com/en-us/library/hh830877">Building Testable Windows Phone Applications</a> – How to easily build testable Windows Phone 7.5 applications.</p>  <p><a href="https://cqrsjourney.github.com/">The CQRS Journey Project</a> – Applying the Command and Query Responsibility Segregation (CQRS) and Event Sourcing (ES) patterns for building scalable applications on Windows Azure.</p>  <p><a href="https://hilo.codeplex.com/">Building Metro-style applications in C++/XAML.</a> – Applying your C++ knowledge in building Windows 8 Metro-style applications with C++/XAML.</p>  <p>&#160;</p>  <p><strong>Where do I apply?</strong></p>  <p>If you’re interested, you can apply through the Microsoft Careers site.&#160; The posting is:</p>  <blockquote>   <p><a href="https://careers.microsoft.com/jobdetails.aspx?ss=&amp;pg=0&amp;so=&amp;rw=1&amp;jid=82997&amp;jlang=en">Sr. Software Development Engineer - 797347</a></p> </blockquote>  <p>This position expects the candidate to work out of the Redmond office.&#160; When you apply be sure to let the recruiter know you’re interested in this specific position and in working for p&amp;p.&#160; You can email me directly as well at bob dot brumfield at micro… dot com.</p>]]></content:encoded>
    </item>
    <item>
      <title>More Prism Goodness</title>
      <link>https://docs.microsoft.com/archive/blogs/bobbrum/more-prism-goodness</link>
      <pubDate>Tue, 15 Nov 2011 16:35:00 GMT</pubDate>
      <dc:creator><![CDATA[brumfb1]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bobbrum/2011/11/15/more-prism-goodness/</guid>
      <description><![CDATA[Brian Noyes (one of our esteemed advisors during Prism) is doing a Working with Prism 4...]]></description>
      <content:encoded><![CDATA[<p>Brian Noyes (one of our esteemed advisors during Prism) is doing a Working with Prism 4 series.&nbsp; You should definitely check it out.</p>
<p>This will be a multi-part series and the<a href="https://tinyurl.com/Prism4Series"> first installment</a> is already up.&nbsp; It sounds like he'll be adjusting the content based on people's interests so be sure to follow along and provide feedback.</p>
<p>More details on his <a href="https://briannoyes.net/">blog</a>.</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Free online Prism 4.0 training</title>
      <link>https://docs.microsoft.com/archive/blogs/bobbrum/free-online-prism-4-0-training</link>
      <pubDate>Tue, 01 Nov 2011 16:50:00 GMT</pubDate>
      <dc:creator><![CDATA[brumfb1]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bobbrum/2011/11/01/free-online-prism-4-0-training/</guid>
      <description><![CDATA[PluralSight and patterns &amp; practices have worked together to provide to you a free, 3-hour...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: arial,helvetica,sans-serif; font-size: small;">PluralSight and patterns &amp; practices have worked together to provide to you a free, 3-hour online training <a title="training course on Prism" href="https://www.pluralsight-training.net/microsoft/Courses/TableOfContents?courseName=prism-introduction">course on Prism</a>.&nbsp; This will be available in a free format for a limited time, from November 12th, 2011&nbsp;through November14th, 2011.&nbsp; </span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: small;">If you've always wanted to know a bit more about Prism, or just wanted to brush up what's in the 4.0 release, this course will help.&nbsp; </span><span style="font-family: arial,helvetica,sans-serif; font-size: small;">The course topics include:</span></p>
<ul>
<li><span style="color: #000000; font-family: arial,helvetica,sans-serif; font-size: small; background-color: #ffffff;">Bootstrapper and Shell</span></li>
<li><span style="color: #000000; font-family: arial,helvetica,sans-serif; font-size: small; background-color: #ffffff;">Regions</span></li>
<li><span style="color: #000000; font-family: arial,helvetica,sans-serif; font-size: small; background-color: #ffffff;">Modules</span></li>
<li><span style="color: #000000; font-family: arial,helvetica,sans-serif; font-size: small; background-color: #ffffff;">Views</span></li>
<li><span style="color: #000000; letter-spacing: -0.3pt; font-family: arial,helvetica,sans-serif; font-size: small; background-color: #ffffff; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;">Navigation<a href="https://www.pluralsight-training.net/microsoft/courses/TableOfContents?courseName=prism-introduction" target="_blank"></a></span></li>
<li><span style="color: #000000; font-family: arial,helvetica,sans-serif; font-size: small; background-color: #ffffff;">Communication</span></li>
</ul>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Become a patterns &amp; practices Developer!</title>
      <link>https://docs.microsoft.com/archive/blogs/bobbrum/become-a-patterns-practices-developer</link>
      <pubDate>Fri, 11 Feb 2011 15:05:00 GMT</pubDate>
      <dc:creator><![CDATA[brumfb1]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bobbrum/2011/02/11/become-a-patterns-practices-developer/</guid>
      <description><![CDATA[I have an opening on the patterns &amp; practices team for a developer.  Patterns &amp; practices...]]></description>
      <content:encoded><![CDATA[<p>I have an opening on the patterns &amp; practices team for a developer.</p>  <p>Patterns &amp; practices works towards helping those developing on the Microsoft platforms more successful.&#160; <a href="https://msdn.microsoft.com/en-us/practices">We produce</a> books, reference implements, and libraries that help people in developing web, client, and mobile applications.&#160; You can find out more what p&amp;p does and how we do on <a href="https://msdn.microsoft.com/en-us/practices/bb969103">our dev center</a>.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/13/17/metablogapi/8666.pp-Team-Room_4C3230AF.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-13-17-metablogapi/8666.pp_2D00_Team_2D00_Room_5F00_4C3230AF.jpg"><img style="background-image: none; border-right-width: 0px; margin: 0px 10px 10px 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="p&amp;p Team Room" border="0" alt="p&amp;p Team Room" align="left" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/13/17/metablogapi/2818.pp-Team-Room_thumb_673AD9F0.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-13-17-metablogapi/2818.pp_2D00_Team_2D00_Room_5F00_thumb_5F00_673AD9F0.jpg" width="177" height="134" /></a>As a p&amp;p developer you will have the opportunity to work on a number of projects throughout the year.&#160; Our projects run between two and six months in length and focus on the latest Microsoft (and related) technology stacks:&#160; ASP.Net MVC, HTML5, Javascript, Azure, Silverlight, WPF, Windows Phone 7, and SharePoint.&#160; You will work with other talented developers, program managers, testers, and writers in an agile process to help customers better understand how to solve specific challenges and help communicate those solutions.</p>  <p>You will get opportunities to meet and talk with customers most weeks, as well as presenting at our yearly <a href="https://msdn.microsoft.com/en-us/practices/dd578307.aspx">p&amp;p symposium</a> and other conferences.&#160; Developers also typically blog, deliver podcasts, and engage in discussions with our customers on our Codeplex forums.</p>  <p><strong>If you were at p&amp;p this year you could have worked on:</strong></p>  <p><a href="https://msdn.microsoft.com/en-us/practices/bb232643">Enterprise Library Silverlight Integration Pack (in progress)</a> – Enabling relevant portions of the Enterprise Library to the Silverlight space, including validation, logging, and exception handling.</p>  <p><a href="https://msdn.microsoft.com/en-us/practices/bb232643">Web Client Guidance (upcoming)</a> – Focusing on building web applications with ASP.Net MVC 3, the Razor View Engine, HTML5, CSS3, and jQuery.</p>  <p><a href="https://msdn.microsoft.com/en-us/library/gg490765.aspx">Windows Phone 7 Developer Guide</a> – Developing Windows Phone 7 applications that interact with Azure.</p>  <p><a href="https://msdn.microsoft.com/en-us/library/ff966499.aspx">Developing Applications for the Cloud</a> – Developing applications on the Microsoft Windows Azure platform.</p>  <p><a href="https://msdn.microsoft.com/en-us/library/gg406140.aspx">Prism 4</a> – Building guidance for developing applications on Silverlight and WPF and Windows Phone 7 using MVVM and modular design concepts.</p>  <p><a href="https://msdn.microsoft.com/en-us/library/ff963553.aspx">Parallel Programming with Microsoft .NET</a> – Approaches and patterns to introducing parallel execution into your code.</p>  <p><strong>Where do I apply?</strong></p>  <p>If you’re interested, you can apply through the Microsoft Careers site.&#160; The posting is:</p>  <blockquote>   <p><a href="https://careers.microsoft.com/JobDetails.aspx?ss=&amp;pg=0&amp;so=&amp;rw=1&amp;jid=35281&amp;jlang=EN">Software Development Engineer - 746816</a></p> </blockquote>  <p>This position expects the candidate to work out of the Redmond office.&#160; When you apply be sure to let the recruiter know you’re interested in this specific position and working for p&amp;p.&#160; You can email me directly as well at bob dot brumfield at micro… dot com.</p>]]></content:encoded>
    </item>
    <item>
      <title>Prism 4 in Silverlight with MEF CompositionInitializer</title>
      <link>https://docs.microsoft.com/archive/blogs/bobbrum/prism-4-in-silverlight-with-mef-compositioninitializer</link>
      <pubDate>Mon, 22 Nov 2010 16:58:00 GMT</pubDate>
      <dc:creator><![CDATA[brumfb1]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bobbrum/2010/11/22/prism-4-in-silverlight-with-mef-compositioninitializer/</guid>
      <description><![CDATA[I’ve had a couple people ping me about how to use the MEF CompositionInitializer with Prism 4 in...]]></description>
      <content:encoded><![CDATA[<p>I’ve had a couple people ping me about how to use the MEF CompositionInitializer with Prism 4 in Silverlight as well as how to use multiple, remotely downloaded Prism modules with MEF.&#160; I’ve put together a sample that shows both these things, you can find the sample below.</p>  <h2>CompositionInitializer</h2>  <p>The MEF CompositionInitializer is intended to provide a way to satisfy MEF imports on an object in situations where you can’t necessarily build the item in the container.&#160; This may occur where you’re using a framework that builds the objects for you, but not in the container of your choice such as in in the application startup logic of a Silverlight application.&#160; </p>  <p>You might use it like this in your Silverlight App.xaml.cs if you wanted to import&#160; something like a logger or main view-model into your App.</p>  <div class="csharpcode">   <pre class="alt"><span class="kwrd">private</span> <span class="kwrd">void</span> Application_Startup(<span class="kwrd">object</span> sender, StartupEventArgs e)</pre>

  <pre>{</pre>

  <pre class="alt">    CompositionInitializer.SatisfyImports(<span class="kwrd">this</span>);</pre>

  <pre>&#160;</pre>

  <pre class="alt">}</pre>

  <pre>&#160;</pre>

  <pre class="alt">...</pre>

  <pre>&#160;</pre>

  <pre class="alt">[Import]</pre>

  <pre><span class="kwrd">public</span> MainViewModel MainViewModel</pre>

  <pre class="alt">{</pre>

  <pre>    get;</pre>

  <pre class="alt">    set;</pre>

  <pre>}</pre>
</div>


<p>You can read a bit more about CompositionInitializer on <a href="https://msdn.microsoft.com/en-us/library/system.componentmodel.composition.compositioninitializer(VS.95).aspx" target="_blank">MSDN</a> and on the <a href="https://mef.codeplex.com/wikipage?title=CompsitionInitializer&amp;ANCHOR" target="_blank">MEF Codeplex</a> site.</p>

<p>Under the covers, the CompositionInitializer is creating its own container and making it available through the CompositionInitializer static interface.&#160; Since Prism also creates it’s own composition container, both Prism and the CompositionInitializer static interfaces need to point to the same container to be able to work together well.&#160;&#160; You can setup this connection in Prism bootstrapper you create for your app by calling CompositionHost.Initialize.&#160; This initializes the CompositionHost with the container that Prism uses of instead of creating a new one.&#160; Perhaps the easiest place to do this in the CreateContainer override of your Prism application bootstrapper:</p>

<div class="csharpcode">
  <div class="csharpcode">
    <pre class="alt"><span class="kwrd">public</span> <span class="kwrd">class</span> AppBootstrapper : MefBootstrapper</pre>

    <pre>{</pre>

    <pre class="alt">...</pre>

    <pre>    <span class="kwrd">protected</span> <span class="kwrd">override</span> CompositionContainer CreateContainer()</pre>

    <pre class="alt">    {</pre>

    <pre>        var container = <span class="kwrd">base</span>.CreateContainer();</pre>

    <pre class="alt">&#160;</pre>

    <pre>        <span class="rem">// Initialize the CompositionHost so we can use CompositionInitializer</span></pre>

    <pre class="alt">        CompositionHost.Initialize(container);</pre>

    <pre>        <span class="kwrd">return</span> container;</pre>

    <pre class="alt">    }</pre>

    <pre>...</pre>

    <pre class="alt">}</pre>
  </div>
</div>

<h2>&#160;</h2>

<h2>Sample With Composition Initializer</h2>

<p>The attached sample application shows a Prism application using CompositionInitializer in two places: in the app startup and in a view’s constructor.&#160; In the App, it uses the initializer to import an ILoggerFacade so it can log the start and exit of the application.&#160; It also shows a view that, in its constructor, uses CompositionInitializer to import its view-model. </p>

<p>The App.xaml.cs starts the bootstrapper (which calls the CompositionHost.Initialize as shown above) then satisfies imports on itself which injects the ILoggerFacade:</p>

<div class="csharpcode">
  <pre class="alt"><span class="kwrd">private</span> <span class="kwrd">void</span> Application_Startup(<span class="kwrd">object</span> sender, StartupEventArgs e)</pre>

  <pre>{</pre>

  <pre class="alt">    <span class="kwrd">new</span> AppBootstrapper().Run();</pre>

  <pre>    CompositionInitializer.SatisfyImports(<span class="kwrd">this</span>);</pre>

  <pre class="alt">    Logger.Log(<span class="str">&quot;Application starting&quot;</span>, Category.Info, Priority.Low);</pre>

  <pre>}</pre>

  <pre>…</pre>

  <div class="csharpcode">
    <pre class="alt">[Import]</pre>

    <pre><span class="kwrd">public</span> ILoggerFacade Logger</pre>

    <pre class="alt">{</pre>

    <pre>    get;</pre>

    <pre class="alt">    set;</pre>

    <pre>}</pre>
  </div>
</div>

<p>After the SatisfyImports call, the Logger dependency will have been resolved and the App can then use that dependency.&#160; Similarly, the InjectedViewWithInitializer uses the CompositionInitializer.SatisfyImports to inject it’s view-model dependencies:</p>

<div class="csharpcode">
  <pre class="alt">    <span class="kwrd">public</span> <span class="kwrd">partial</span> <span class="kwrd">class</span> InjectedViewWithInitializer : UserControl</pre>

  <pre>    {</pre>

  <pre class="alt">        <span class="kwrd">public</span> InjectedViewWithInitializer()</pre>

  <pre>        {</pre>

  <pre class="alt">            InitializeComponent();</pre>

  <pre>&#160;</pre>

  <pre class="alt">            <span class="rem">// Using CompositionInitializer to satisfy imports for this view.</span></pre>

  <pre>            <span class="rem">// Because the AppBootstrapper called CompositionHost.Initialize()</span></pre>

  <pre class="alt">            <span class="rem">// the container is the same as the one built up by Prism.</span></pre>

  <pre>            CompositionInitializer.SatisfyImports(<span class="kwrd">this</span>);</pre>

  <pre class="alt">        }</pre>

  <pre>&#160;</pre>

  <pre class="alt">        [Import(<span class="kwrd">typeof</span>(TimerViewModel))]</pre>

  <pre>        <span class="kwrd">public</span> <span class="kwrd">object</span> ViewModel</pre>

  <pre class="alt">        {</pre>

  <pre>            get { <span class="kwrd">return</span> <span class="kwrd">this</span>.DataContext; }</pre>

  <pre class="alt">            set { <span class="kwrd">this</span>.DataContext = <span class="kwrd">value</span>;}</pre>

  <pre>        }</pre>

  <pre class="alt">    }</pre>
</div>

<h2>&#160;</h2>

<h2>Prism, MEF, and Shared Services</h2>

<p>When sharing these services across remotely downloaded modules, there is not much difference from doing this with MEF than with a container like Unity. For this sample, there is a service module that offers an implementation of a TimeService that simply returns the current time and two modules that provide views consuming the time service.&#160; Here’s what it looks like:</p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/13/17/metablogapi/2781.image_2.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-13-17-metablogapi/2781.image_5F00_2.png"><img style="background-image: none; border-right-width: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/13/17/metablogapi/1526.image_thumb.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-13-17-metablogapi/1526.image_5F00_thumb.png" width="244" height="205" /></a> 

  <br /></p>

<p>Not too fancy, but it hopefully demonstrates the point.&#160; ModuleA and ModuleB are dependent upon the TimeServiceModule.&#160; ModuleA provides two views:&#160; one view uses CompositionInitializer to resolve it’s view-model and one view receives it’s view-model when it’s constructed in the MEF container by the RegionManager.&#160; ModuleB provides a view that directly imports the TimeService.&#160; </p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/13/17/metablogapi/7080.image_4.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-13-17-metablogapi/7080.image_5F00_4.png"><img style="background-image: none; border-right-width: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/13/17/metablogapi/7571.image_thumb_1.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-13-17-metablogapi/7571.image_5F00_thumb_5F00_1.png" width="470" height="295" /></a></p>

<p>The modules don’t directly know about each other.&#160; The ITimeService implementation is in a shared assembly.&#160; The Prism ModuleCatalog.xaml defines the dependencies between the modules and specifies that all modules are downloaded in the background and initialized when available:</p>

<div class="csharpcode">
  <pre class="alt">    <span class="kwrd">&lt;</span><span class="html">Modularity:ModuleInfoGroup</span><span class="kwrd">&gt;</span></pre>

  <pre>        <span class="kwrd">&lt;</span><span class="html">Modularity:ModuleInfo</span> <span class="attr">Ref</span><span class="kwrd">=&quot;TimeService.xap&quot;</span> <span class="attr">InitializationMode</span><span class="kwrd">=&quot;WhenAvailable&quot;</span> <span class="attr">ModuleName</span><span class="kwrd">=&quot;TimeService&quot;</span>  <span class="kwrd">/&gt;</span></pre>

  <pre class="alt">        <span class="kwrd">&lt;</span><span class="html">Modularity:ModuleInfo</span> <span class="attr">Ref</span><span class="kwrd">=&quot;ModuleA.xap&quot;</span> <span class="attr">InitializationMode</span><span class="kwrd">=&quot;WhenAvailable&quot;</span> <span class="attr">ModuleName</span><span class="kwrd">=&quot;ModuleA&quot;</span><span class="kwrd">&gt;</span></pre>

  <pre>            <span class="kwrd">&lt;</span><span class="html">Modularity:ModuleInfo.DependsOn</span><span class="kwrd">&gt;</span></pre>

  <pre class="alt">                <span class="kwrd">&lt;</span><span class="html">sys:String</span><span class="kwrd">&gt;</span>TimeService<span class="kwrd">&lt;/</span><span class="html">sys:String</span><span class="kwrd">&gt;</span></pre>

  <pre>            <span class="kwrd">&lt;/</span><span class="html">Modularity:ModuleInfo.DependsOn</span><span class="kwrd">&gt;</span></pre>

  <pre class="alt">        <span class="kwrd">&lt;/</span><span class="html">Modularity:ModuleInfo</span><span class="kwrd">&gt;</span></pre>

  <pre>        <span class="kwrd">&lt;</span><span class="html">Modularity:ModuleInfo</span> <span class="attr">Ref</span><span class="kwrd">=&quot;ModuleB.xap&quot;</span> <span class="attr">InitializationMode</span><span class="kwrd">=&quot;WhenAvailable&quot;</span> <span class="attr">ModuleName</span><span class="kwrd">=&quot;ModuleB&quot;</span><span class="kwrd">&gt;</span></pre>

  <pre class="alt">            <span class="kwrd">&lt;</span><span class="html">Modularity:ModuleInfo.DependsOn</span><span class="kwrd">&gt;</span></pre>

  <pre>                <span class="kwrd">&lt;</span><span class="html">sys:String</span><span class="kwrd">&gt;</span>TimeService<span class="kwrd">&lt;/</span><span class="html">sys:String</span><span class="kwrd">&gt;</span></pre>

  <pre class="alt">            <span class="kwrd">&lt;/</span><span class="html">Modularity:ModuleInfo.DependsOn</span><span class="kwrd">&gt;</span></pre>

  <pre>        <span class="kwrd">&lt;/</span><span class="html">Modularity:ModuleInfo</span><span class="kwrd">&gt;</span></pre>

  <pre class="alt">    <span class="kwrd">&lt;/</span><span class="html">Modularity:ModuleInfoGroup</span><span class="kwrd">&gt;</span></pre>
</div>

<p>&#160;</p>

<p>During ModuleA initialize, the InjectedViewWithInitializer is constructed and added directly to the region on the shell:</p>

<div class="csharpcode">
  <pre class="alt"><span class="kwrd">public</span> <span class="kwrd">void</span> Initialize()</pre>

  <pre>{</pre>

  <pre class="alt">    logger.Log(<span class="str">&quot;Initializing ModuleA&quot;</span>, Category.Info, Priority.Low);</pre>

  <pre>&#160;</pre>

  <pre class="alt">    <span class="rem">// We create a new instance of InjectedViewWithInitializer and add it to the region.</span></pre>

  <pre>    <span class="rem">// Inside InjectedViewWithInitializer, it uses CompositionInitializer.SatisfyImports(this)</span></pre>

  <pre class="alt">    <span class="rem">// to resolve its dependencies.</span></pre>

  <pre>    <span class="rem">// Because we initialize the CompositionHost in the bootstrapper with the container</span></pre>

  <pre class="alt">    <span class="rem">// that Prism will use, it can get all the services registered with Prism</span></pre>

  <pre>    <font style="background-color: #ffff00"><span class="kwrd">this</span>.regionManager.Regions[<span class="str">&quot;ContentRegion&quot;</span>].Add(<span class="kwrd">new</span> InjectedViewWithInitializer());</font></pre>

  <pre class="alt">&#160;</pre>

  <pre>    <span class="rem">// Another approach is to use the view registry which will automatically build</span></pre>

  <pre class="alt">    <span class="rem">// the type up in the container:</span></pre>

  <pre>    <span class="kwrd">this</span>.registry.RegisterViewWithRegion(<span class="str">&quot;ContentRegion&quot;</span>, <span class="kwrd">typeof</span>(RegionRegisteredView));</pre>

  <pre class="alt">}</pre>
</div>

<p>Module A also shows another approach to building a view against a region, one more traditionally used in Prism .&#160; This registers a view’s type against a region so that the view is built&#160; when the region is shown (also known as view discovery).&#160; Since the view is built in the MEF container during this process, any of it’s [Import] or [ImportingConstructor] dependencies are satisfied.</p>

<p>Module B shows another view that relies on the TimeService merely to demonstrate multiple modules dependent on the same service.&#160; In this sample, the ITimeService interface actually lives in a separate Shared assembly while the exported implementation lives in TimeService assembly.</p>

<p>One thing to be wary of with MEF and using remotely downloaded modules in Prism is having more than one module reference the same assembly that include [Export] attributes.&#160; By default, adding a reference to an assembly will set the CopyLocal property to True which means a copy of the referenced assembly is included in the modules Xap file.&#160; When using MEF, Prism uses the DeploymentCatalog to retrieve the module Xaps.&#160; As these Xaps are downloaded, the DeploymentCatalog will add these assemblies to the MEF container.&#160; If more than one Xap includes the same assembly, it will be exported multiple times.&#160; This may result in a MEF recomposition error like the one shown below if the export cannot be ‘recomposed’ (more information about MEF DeploymentCatalog and recomposition is available on the <a href="https://mef.codeplex.com/wikipage?title=DeploymentCatalog&amp;referringTitle=Recomposition" target="_blank">MEF Codeplex site</a>.):</p>

<blockquote>
  <p>The composition remains unchanged. The changes were rejected because of the following error(s): The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.</p>

  <p>1) Change in exports prevented by non-recomposable import 'ModuleA.TimerViewModel..ctor (Parameter=&quot;timeService&quot;, ContractName=&quot;ServiceModule.ITimeService&quot;)' on part 'ModuleA.TimerViewModel'.</p>

  <p>Check the InnerException property of the exception for more information. If the exception occurred while creating an object in a DI container, you can exception.GetRootException() to help locate the root cause of the problem. </p>
</blockquote>

<p>You can solve this by making sure the assembly is included in only one Xap file by setting the CopyLocal property to False for all but a single Xap.</p>

<p><font size="2" face="Tahoma"><strong>Compiling the Sample</strong></font></p>

<p><font face="Tahoma"><font size="2">You will need to download and reference the Prism binaries from the </font></font><a href="https://www.microsoft.com/downloads/en/details.aspx?FamilyID=3453ab2b-2067-41e4-b087-312d8385cf1b&amp;displaylang=en" target="_blank"><font size="2" face="Tahoma">MSDN</font></a><font size="2" face="Tahoma"> web site.&#160; You may also need to set <strong>_MainApplication.Web</strong> as the startup project.</font></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/10/09/51/97/PrismMefSatisfyImports.zip" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-10-09-51-97/PrismMefSatisfyImports.zip">PrismMefSatisfyImports.zip</a></p>]]></content:encoded>
    </item>
    <item>
      <title>David Platt has a 3-day class on Prism Nov 8-10</title>
      <link>https://docs.microsoft.com/archive/blogs/bobbrum/david-platt-has-a-3-day-class-on-prism-nov-8-10</link>
      <pubDate>Thu, 16 Sep 2010 15:10:52 GMT</pubDate>
      <dc:creator><![CDATA[brumfb1]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bobbrum/2010/09/16/david-platt-has-a-3-day-class-on-prism-nov-8-10/</guid>
      <description><![CDATA[David Platt of Rolling Thunder Computing, is doing a 3-day online Prism class this Nov 8-10.&#160;...]]></description>
      <content:encoded><![CDATA[<p>David Platt of Rolling Thunder Computing, is doing a 3-day online Prism class this Nov 8-10.&#160; </p>  <p>He has some early bird pricing until the end of the month.&#160; Find out more details here: <a href="https://www.programprism.com">www.programprism.com</a>. </p>  <p>He’s always a treat to listen and learn from, so if you’re interested in getting started with Prism or learning a bit more about it, check out this class.</p>]]></content:encoded>
    </item>
    <item>
      <title>Prism V2.2 Posted to Codeplex</title>
      <link>https://docs.microsoft.com/archive/blogs/bobbrum/prism-v2-2-posted-to-codeplex</link>
      <pubDate>Fri, 28 May 2010 10:53:01 GMT</pubDate>
      <dc:creator><![CDATA[brumfb1]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bobbrum/2010/05/28/prism-v2-2-posted-to-codeplex/</guid>
      <description><![CDATA[The updates to the Prism source outlined here, have been packaged as downloadable release on...]]></description>
      <content:encoded><![CDATA[<p>The updates to the Prism source outlined <a href="https://blogs.msdn.com/bobbrum/archive/2010/04/23/prism-source-updated-for-unity-2-0-and-silverlight-4.aspx">here</a>, have been <a href="https://prism.codeplex.com/releases/view/46046">packaged as downloadable release</a> on Codeplex.</p>  <p>This is largely the same code, with these additional items:</p>  <ul>   <li>Added the Quickstarts and Acceptance test projects back in.&#160; These are the same as the ones available in version 2.1. </li>    <li>A more complete test pass. </li>    <li>A smoke test when targeting all projects to .Net 4.0 </li> </ul>  <p>Additionally, we’ve posted the source to the ProjectLinker that can also work in VS2010.&#160; We plan on shortly posting the ProjectLinker to the <a href="https://visualstudiogallery.msdn.microsoft.com/en-us/" target="_blank">Visual Studio Gallery</a>, to make it a bit easier to consume.</p>]]></content:encoded>
    </item>
    <item>
      <title>Prism Source Updated for Unity 2.0 and Silverlight 4</title>
      <link>https://docs.microsoft.com/archive/blogs/bobbrum/prism-source-updated-for-unity-2-0-and-silverlight-4</link>
      <pubDate>Fri, 23 Apr 2010 16:58:55 GMT</pubDate>
      <dc:creator><![CDATA[brumfb1]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bobbrum/2010/04/23/prism-source-updated-for-unity-2-0-and-silverlight-4/</guid>
      <description><![CDATA[We’re getting started with our Prism v4 work, but we have received a number of inquiries regarding...]]></description>
      <content:encoded><![CDATA[<p>We’re getting started with our Prism v4 work, but we have received a number of inquiries regarding updating the source to use Unity 2.0 and Silverlight 4.0.&#160; To help those interested in using Prism with these latest releases, we’ve updated the source in the <a href="https://compositewpf.codeplex.com/SourceControl/list/changesets">Codeplex repository</a>.</p>  <p>The changes are:</p>  <ul>   <li>All projects updated to Visual Studio 2010</li>    <ul>     <li>All test projects now target .Net 4.0 </li>      <li>Note: The WPF library projects still target .Net 3.5</li>   </ul>    <li>All Silverlight projects update to target Silverlight 4.0</li>    <li>Prism is updated to use the latest Unity 2.0 binaries.</li>    <li>The Reference Implementation uses the latest Unity 2.0 and Enterprise Library 5.0 binaries.</li>    <li>The Silverlight Reference Implementation now uses the latest binaries from the Silverlight Toolkit (primarily for charting).</li> </ul>  <p>This update does not include converted Quickstarts or a VS2010 version of the ProjectLinker.</p>  <p>While the code is largely unchanged, we have only done light smoke testing on this after the updates so use at your own risk.&#160; If you do encounter any problems with these updates, let us know.</p>]]></content:encoded>
    </item>
    <item>
      <title>Enterprise Library 5.0 is out.</title>
      <link>https://docs.microsoft.com/archive/blogs/bobbrum/enterprise-library-5-0-is-out</link>
      <pubDate>Tue, 20 Apr 2010 20:43:30 GMT</pubDate>
      <dc:creator><![CDATA[brumfb1]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bobbrum/2010/04/20/enterprise-library-5-0-is-out/</guid>
      <description><![CDATA[Enterprise Library 5.0 is now out.&#160; You can read more on Grigori’s post.&#160; If you just...]]></description>
      <content:encoded><![CDATA[<p>Enterprise Library 5.0 is now out.&#160; You can read more on <a href="https://blogs.msdn.com/agile/archive/2010/04/20/microsoft-enterprise-library-5-0-released.aspx">Grigori’s post</a>.&#160; If you just can’t possibly wait you can also get <a href="https://msdn.microsoft.com/en-us/library/ff632023.aspx">bits from MSDN</a>.</p>  <p>Enjoy and be sure to give us feedback on the <a href="https://entlib.codeplex.com/">EntLib Codeplex site</a>.</p>]]></content:encoded>
    </item>
    <item>
      <title>GAT/GAX Dev10 RC Available</title>
      <link>https://docs.microsoft.com/archive/blogs/bobbrum/gatgax-dev10-rc-available</link>
      <pubDate>Thu, 18 Mar 2010 17:17:15 GMT</pubDate>
      <dc:creator><![CDATA[brumfb1]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bobbrum/2010/03/18/gatgax-dev10-rc-available/</guid>
      <description><![CDATA[Release candidates of the Guidance Automation Toolkit and Guidance Automation Extensions for Dev10...]]></description>
      <content:encoded><![CDATA[<p>Release candidates of the Guidance Automation Toolkit and Guidance Automation Extensions for Dev10 have been posted to the Visual Studio Gallery.&#160; Check out <a href="https://cut.ms/Ozu">this post</a> for more details.</p>]]></content:encoded>
    </item>
  </channel>
</rss>