<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>&#60; web:Blog x:Name=&#34;Brian Lagunas&#34; &#47;&#62; &#187; Prism</title>
	<atom:link href="http://www.brianlagunas.com/index.php/category/prism/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.brianlagunas.com</link>
	<description></description>
	<lastBuildDate>Sat, 05 Nov 2011 04:26:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>Free Pluralsight Prism Training</title>
		<link>http://www.brianlagunas.com/index.php/2011/11/04/free-prism-training/</link>
		<comments>http://www.brianlagunas.com/index.php/2011/11/04/free-prism-training/#comments</comments>
		<pubDate>Sat, 05 Nov 2011 04:26:23 +0000</pubDate>
		<dc:creator>Brian Lagunas</dc:creator>
				<category><![CDATA[Pluralsight]]></category>
		<category><![CDATA[Prism]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[training]]></category>
		<category><![CDATA[windows phone 7]]></category>

		<guid isPermaLink="false">http://www.brianlagunas.com/index.php/2011/11/04/free-prism-training/</guid>
		<description><![CDATA[I am excited to announce that Pluralsight and Microsoft’s Patterns &#38; Practices team have joined forces to provide you with free access to over 4 hours of online Prism training.&#160; That’s right, you heard me correctly. FREE online Prism training sponsored by the one and only Patterns &#38; Practices team.&#160; I know you have some [...]]]></description>
			<content:encoded><![CDATA[<p>I am excited to announce that <a href="http://www.pluralsight-training.net/microsoft/" target="_blank">Pluralsight</a> and <a href="http://msdn.microsoft.com/en-us/practices/bb190332" target="_blank">Microsoft’s Patterns &amp; Practices</a> team have joined forces to provide you with free access to over 4 hours of online Prism training.&#160; That’s right, you heard me correctly. FREE online Prism training sponsored by the one and only Patterns &amp; Practices team.&#160; I know you have some question so let me answer the most common:</p>
<h4>Q &amp; A</h4>
<p><strong>Q1. When is this free training available?</strong>     <br />A1. The entire weekend of Nov 12th 2011 through Nov 14th 2011.</p>
<p><strong>Q2. Do I have to be a Pluralsight subscriber to get this awesome training?</strong>     <br />A2. This training will be freely available to everyone. You do not have to be a subscriber.</p>
<p><strong>Q3. What does the course cover?</strong>     <br />A3. Well let’s take a look:</p>
<ul>
<li>Getting started with Prism </li>
<li>Bootstrapper and Shell </li>
<li>Regions </li>
<li>Modules </li>
<li>Views </li>
<li>Communication </li>
<li>State-Based Navigation </li>
<li>View-Based Navigation </li>
</ul>
<p><a href="http://www.pluralsight-training.net/microsoft/Courses/TableOfContents?courseName=prism-introduction" target="_blank"><em>More course information.</em></a></p>
<p><strong>Q4. Who is the author of this kick ass Prism course?</strong>     <br />Q4. That would be me.</p>
<p><strong>Q5. Is it really free?</strong>     <br />Q5. You’re kidding right? Didn’t I already cover this part? Yes, it is free.</p>
<h4>New and Improved</h4>
<p>If you are a subscriber and have already watched the course, I would like to bring to your attention that there have been two new modules added.&#160; These modules will cover everything you need to know in order to start using the navigation services provided by Prism.&#160; This includes state-based navigation and view-based navigation.</p>
<p>Mark your calendar for Nov 12th and be sure to cram as much Prism knowledge into your brain as you can before the weekend ends.&#160; Don’t worry, if you run out of time you can always ask me questions directly.&#160; You can contact me either through Twitter (@<a href="http://twitter.com/brianlagunas" target="_blank">brianlagunas</a>) or through the <a href="http://wpftoolkit.codeplex.com/" target="_blank">Extended WPF Toolkit</a> project site.&#160; I hope you enjoy the training.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brianlagunas.com/index.php/2011/11/04/free-prism-training/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Prism-fy the Bing Maps WPF Control (Beta)</title>
		<link>http://www.brianlagunas.com/index.php/2011/08/31/prism-fy-the-bing-maps-wpf-control-beta/</link>
		<comments>http://www.brianlagunas.com/index.php/2011/08/31/prism-fy-the-bing-maps-wpf-control-beta/#comments</comments>
		<pubDate>Wed, 31 Aug 2011 16:12:16 +0000</pubDate>
		<dc:creator>Brian Lagunas</dc:creator>
				<category><![CDATA[Prism]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[XAML]]></category>
		<category><![CDATA[bing maps]]></category>

		<guid isPermaLink="false">http://www.brianlagunas.com/index.php/2011/08/31/prism-fy-the-bing-maps-wpf-control-beta/</guid>
		<description><![CDATA[If you know me or know of me you are aware that I am a big Prism advocate/evangelist.&#160; You may have also noticed that I have been playing around with the new Bing Maps WPF control.&#160; So it shouldn’t surprise you that I would find a way to compose a Bing Map of loosely coupled [...]]]></description>
			<content:encoded><![CDATA[<p>If you know me or know of me you are aware that I am a big Prism advocate/evangelist.&#160; You may have also noticed that I have been <a href="http://elegantcode.com/2011/08/26/build-an-earthquake-application-with-bing-maps-wpf-control-beta/" target="_blank">playing</a> <a href="http://elegantcode.com/2011/08/30/mapping-an-address-with-the-bing-maps-wpf-control-beta/" target="_blank">around</a> with the new Bing Maps WPF control.&#160; So it shouldn’t surprise you that I would find a way to compose a Bing Map of loosely coupled MapLayers at runtime using Prism.</p>
<p>The concept is simple.&#160; We want a Bing Maps application that can be extended at runtime.&#160; By extended, I mean that I want the ability to add new elements/modules to the Map at runtime.&#160; The important thing about these elements/modules is that they can come from anywhere and they should be loosely coupled from the Map as well as other elements/modules that may exist on the Map.</p>
<p>Luckily for us this is extremely simple to accomplish.&#160; All we have to do is create a custom RegionAdapter, register it with our Prism application, and then apply it to our Bing Map control.&#160; So let’s start with the RegionAdapter.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:e8809704-1b89-4479-9f50-32a29a8ce6e3" class="wlWriterEditableSmartContent">
<div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt">
<div style="background-color: #ffffff; max-height: 300px; overflow: auto; padding: 2px 5px; white-space: nowrap"><span style="color:#0000ff">public</span> <span style="color:#0000ff">class</span> <span style="color:#2b91af">MapRegionAdapter</span> : <span style="color:#2b91af">RegionAdapterBase</span>&lt;<span style="color:#2b91af">Map</span>&gt;<br /> {<br />     <span style="color:#0000ff">public</span> MapRegionAdapter(<span style="color:#2b91af">IRegionBehaviorFactory</span> regionBehaviorFactory)<br />         : <span style="color:#0000ff">base</span>(regionBehaviorFactory)<br />     {</p>
<p>     }</p>
<p>     <span style="color:#0000ff">protected</span> <span style="color:#0000ff">override</span> <span style="color:#0000ff">void</span> Adapt(<span style="color:#2b91af">IRegion</span> region, <span style="color:#2b91af">Map</span> regionTarget)<br />     {<br />         region.Views.CollectionChanged += (s, e) =&gt;<br />         {<br />             <span style="color:#0000ff">if</span> (e.Action == System.Collections.Specialized.<span style="color:#2b91af">NotifyCollectionChangedAction</span>.Add)<br />             {<br />                 <span style="color:#0000ff">foreach</span> (<span style="color:#2b91af">FrameworkElement</span> element <span style="color:#0000ff">in</span> e.NewItems)<br />                     regionTarget.Children.Add(element);<br />             }<br />             <span style="color:#0000ff">else</span> <span style="color:#0000ff">if</span> (e.Action == System.Collections.Specialized.<span style="color:#2b91af">NotifyCollectionChangedAction</span>.Remove)<br />             {<br />                 <span style="color:#0000ff">foreach</span> (<span style="color:#2b91af">FrameworkElement</span> element <span style="color:#0000ff">in</span> e.OldItems)<br />                     <span style="color:#0000ff">if</span> (regionTarget.Children.Contains(element))<br />                         regionTarget.Children.Remove(element);<br />             }<br />         };<br />     }</p>
<p>     <span style="color:#0000ff">protected</span> <span style="color:#0000ff">override</span> <span style="color:#2b91af">IRegion</span> CreateRegion()<br />     {<br />         <span style="color:#0000ff">return</span> <span style="color:#0000ff">new</span> <span style="color:#2b91af">AllActiveRegion</span>();<br />     }<br /> }</div>
</p></div>
</p></div>
<p>Now in the Bootstrapper we need to register our mapping.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:fce11974-ec82-4641-ac5c-a37a9ff443df" class="wlWriterEditableSmartContent">
<div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt">
<div style="background-color: #ffffff; max-height: 300px; overflow: auto; padding: 2px 5px; white-space: nowrap"><span style="color:#0000ff">protected</span> <span style="color:#0000ff">override</span> <span style="color:#2b91af">RegionAdapterMappings</span> ConfigureRegionAdapterMappings()<br /> {<br />     <span style="color:#2b91af">RegionAdapterMappings</span> mappings = <span style="color:#0000ff">base</span>.ConfigureRegionAdapterMappings();<br />     mappings.RegisterMapping(<span style="color:#0000ff">typeof</span>(<span style="color:#2b91af">Map</span>), Container.Resolve&lt;<span style="color:#2b91af">MapRegionAdapter</span>&gt;());<br />     <span style="color:#0000ff">return</span> mappings;<br /> }</div>
</p></div>
</p></div>
<p>Now we simply give the Map a region name. (this is actually all the shell has in it)</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:a72303d9-120c-4bba-a39e-18ae1979a63a" class="wlWriterEditableSmartContent">
<div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt">
<div style="background-color: #ffffff; max-height: 300px; overflow: auto; padding: 2px 5px; white-space: nowrap"><span style="color:#a31515"></span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">Grid</span><span style="color:#0000ff">&gt;</span><br />     <span style="color:#a31515"></span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">bing</span><span style="color:#0000ff">:</span><span style="color:#a31515">Map</span><span style="color:#ff0000"> prism</span><span style="color:#0000ff">:</span><span style="color:#ff0000">RegionManager.RegionName</span><span style="color:#0000ff">=&quot;{</span><span style="color:#a31515">x</span><span style="color:#0000ff">:</span><span style="color:#a31515">Static</span><span style="color:#ff0000"> inf</span><span style="color:#0000ff">:</span><span style="color:#ff0000">RegionNames</span><span style="color:#0000ff">.MapRegion}&quot;</span><span style="color:#ff0000"> Center</span><span style="color:#0000ff">=&quot;40,-95&quot;</span><span style="color:#ff0000"> ZoomLevel</span><span style="color:#0000ff">=&quot;4&quot; /&gt;</span><br /> <span style="color:#a31515"></span><span style="color:#0000ff">&lt;/</span><span style="color:#a31515">Grid</span><span style="color:#0000ff">&gt;</span></div>
</p></div>
</p></div>
<p>That is all there is to it.&#160; You can now start injecting modules onto the Map at runtime.&#160; Lets look at my two modules I am using as an example.&#160; Here is the structure of my application:</p>
<p><a href="http://www.brianlagunas.com/wp-content/uploads/2011/08/image9.png"><img style="background-image: none; border-right-width: 0px; 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="http://www.brianlagunas.com/wp-content/uploads/2011/08/image_thumb9.png" width="305" height="190" /></a></p>
<ul>
<li>ModuleA will inject a MapPolygon in the Shape of Texas. </li>
<li>ModuleB is the Earthquake application we built in an <a href="http://elegantcode.com/2011/08/26/build-an-earthquake-application-with-bing-maps-wpf-control-beta/" target="_blank">earlier post</a>. </li>
<li>Infrastructure is the project where shared code goes, in this case our MapRegionAdapter </li>
<li>BingMapsPrismfiedDemo is of course our shell project. </li>
</ul>
<p>This is what the application looks like at runtime when both modules have been injected into it.</p>
<p><a href="http://www.brianlagunas.com/wp-content/uploads/2011/08/image10.png"><img style="background-image: none; border-right-width: 0px; 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="http://www.brianlagunas.com/wp-content/uploads/2011/08/image_thumb10.png" width="644" height="334" /></a></p>
<p>Now I can easily add more layers to this map as I see fit.&#160; As always, <a href="http://www.brianlagunas.com/downloads/source/BingMapsPrismfiedDemo.zip">Download the Source</a> and start playing.&#160; You may want to add MEF support as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brianlagunas.com/index.php/2011/08/31/prism-fy-the-bing-maps-wpf-control-beta/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BSDG &#8211; PRISM/MVVM for WPF Presentation Sample Code</title>
		<link>http://www.brianlagunas.com/index.php/2009/06/05/bsdg-prismmvvm-for-wpf-presentation-sample-code/</link>
		<comments>http://www.brianlagunas.com/index.php/2009/06/05/bsdg-prismmvvm-for-wpf-presentation-sample-code/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 14:40:45 +0000</pubDate>
		<dc:creator>Brian Lagunas</dc:creator>
				<category><![CDATA[BSDG]]></category>
		<category><![CDATA[Prism]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[mvvm]]></category>
		<category><![CDATA[presentations]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2009/06/05/bsdg-prismmvvm-for-wpf-presentation-sample-code/</guid>
		<description><![CDATA[As promised, I am posting the sample code I covered in the presentation for everyone to download and start playing with.&#160; If you have any questions or would like me to discuss a specific aspect in more detail just drop me a line. Download the Presentation Source.&#160; This contains the all sample code that I [...]]]></description>
			<content:encoded><![CDATA[<p>As promised, I am posting the sample code I covered in the presentation for everyone to download and start playing with.&#160; If you have any questions or would like me to discuss a specific aspect in more detail just drop me a line.</p>
<p><a href="http://brianlagunas.com/Downloads/Presentations/Prism_MVVM_Demo.zip">Download the Presentation Source</a>.&#160; This contains the all sample code that I discussed during the presentation.</p>
<p>Useful links:</p>
<ul>
<li>The <a href="http://compositewpf.codeplex.com/" target="_blank">Composite WPF and Silverlight</a> (Prism) website is where you want to start. </li>
<li><a href="http://elegantcode.com/2009/04/22/code-cast-26-prism-20/" target="_blank">Elegant Code Cast of Prism v2</a> – David Starr, Scott Nichols, and myself sat down with the Patterns and Practices team to discuss Prism. </li>
<li><a href="http://channel9.msdn.com/tags/Prism/" target="_blank">Channel9</a> has some good videos available to help you understand and get started using Prism. </li>
<li><a href="http://www.amazon.com/WPF-Recipes-2008-Problem-Solution-Approach/dp/1430210842/ref=sr_1_2?ie=UTF8&amp;s=books&amp;qid=1238262991&amp;sr=1-2" target="_blank">WPF Recipes in C# 2008: A Problem-Solution Approach</a> – This is not a Prism book but it is a great book for solving common problems in WPF. </li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.brianlagunas.com/index.php/2009/06/05/bsdg-prismmvvm-for-wpf-presentation-sample-code/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

