<?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>Southworks Blogs &#187; patterns and practices</title>
	<atom:link href="http://blogs.southworks.net/category/patterns-and-practices/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.southworks.net</link>
	<description>Powered by Southworks</description>
	<lastBuildDate>Tue, 14 May 2013 19:36:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Prism Training Kit: Updated to Prism 4.0</title>
		<link>http://blogs.southworks.net/matiasb/2010/11/16/prism-training-kit-updated-to-prism-4-0/</link>
		<comments>http://blogs.southworks.net/matiasb/2010/11/16/prism-training-kit-updated-to-prism-4-0/#comments</comments>
		<pubDate>Tue, 16 Nov 2010 19:34:50 +0000</pubDate>
		<dc:creator>Matias Bonaventura</dc:creator>
				<category><![CDATA[Composite Application Guidance]]></category>
		<category><![CDATA[Emerging Technologies]]></category>
		<category><![CDATA[Guidance]]></category>
		<category><![CDATA[Prism]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[patterns and practices]]></category>
		<category><![CDATA[Patterns and Practices]]></category>
		<category><![CDATA[Prism 4.0]]></category>
		<category><![CDATA[Training Kit]]></category>

		<guid isPermaLink="false">http://61.68</guid>
		<description><![CDATA[... <a href="http://blogs.southworks.net/matiasb/2010/11/16/prism-training-kit-updated-to-prism-4-0/" class="more-link">read more<img src="http://blogs.southworks.net/wp-content/themes/southworks/assets/img/arrow-blue.png" width="12" height="12" alt="" /></a>]]></description>
			<content:encoded><![CDATA[<p>Are you new to Prism? Do you want to learn about the new features of Prism 4? Or are you searching for Prism training resources? If you are, this post is for you…</p>
<p>Fast Download links : <a href="http://prismtk.codeplex.com/releases/55821/download/167872">Prism Training Kit 1.1</a> | <a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=3453ab2b-2067-41e4-b087-312d8385cf1b&amp;displaylang=en">Prism 4</a></p>
<p>A <a href="http://karlshifflett.wordpress.com/2010/11/12/prism-4-0-for-visual-studio-2010-net-framework-4-0-wpf-silverlight-4/">new version of Prism</a> (aka Composite Application Guidance for WPF and Silverlight) has been officially released last week, and the community has been very enthusiastic about it.&#160; You can read more about this on <a href="http://blogs.southworks.net/dpoza/2010/11/15/prism-4-0-released/">Diego’s blog</a> and <a href="http://blogs.msdn.com/b/kashiffl/archive/2010/11/12/prism-4-0-for-visual-studio-2010-net-framework-4-0-wpf-amp-silverlight-4.aspx">Karl&#8217;s blog</a>.</p>
<p>With <a href="http://blogs.southworks.net/dschenkelman/">Damian</a>, <a href="http://blogs.southworks.net/dpoza/">Diego</a>, <a href="http://blogs.southworks.net/gmaliandi/">Guido</a> and&#160; <a href="http://blogs.southworks.net/ejadib/">Ezequiel</a> we have updated the <a href="http://prismtk.codeplex.com/">Prism Training Kit</a> (now it’s version 1.1 <img src='http://blogs.southworks.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  ) to target the new bits of Prism 4. The Beta Training Kit includes 5 Hands-On-Labs that cover some of Prism&#8217;s core concepts (<a href="http://msdn.microsoft.com/en-us/library/gg405479%28PandP.40%29.aspx">modularity</a>, <a href="http://msdn.microsoft.com/en-us/library/gg430868%28PandP.40%29.aspx">bootstrapping</a>, <a href="http://msdn.microsoft.com/en-us/library/ff921140%28PandP.40%29.aspx">dependency injection</a>, <a href="http://msdn.microsoft.com/en-us/library/ff921098%28PandP.40%29.aspx">UIComposition</a> and <a href="http://msdn.microsoft.com/en-us/library/ff921122%28PandP.40%29.aspx">Communication</a>), which are now using Prism 4 assemblies. We also take the oportunity to solve the all the bugs that were reported. If you want to know more about prism training kit content you can read <a href="http://blogs.southworks.net/dschenkelman/2010/07/02/prism-training-kit-beta-version-available/">Prism Training Kit: Beta Version Available</a>.</p>
<p>Additionally, as we had received very good feedback from the community about the training kit (which has 1000+ downloads <img src='http://blogs.southworks.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  ), this week we plan to add new content to the training kit tackling the new concepts introduced in Prism 4. We have in mind adding the following new labs:</p>
<ul>
<li>Using Managed Extensibility Framework (MEF) with Prism Applications. </li>
<li>Prism Navigation Framework. </li>
<li>Prism 4 Windows Phone 7 </li>
</ul>
<p>(We intentionally left MVVM out, as there are already very good samples in <a href="http://karlshifflett.wordpress.com/2010/11/07/in-the-box-ndash-mvvm-training/">Karl’s in-the-box MVVM training</a>).</p>
<p>If you feel we are missing something important please let us know <img src='http://blogs.southworks.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  Your feedback is really appreciated!</p>
<p><a href="http://blogs.southworks.net/matiasb/files/2010/11/image.png"><img style="border-right-width: 0px;border-top-width: 0px;border-bottom-width: 0px;border-left-width: 0px" border="0" alt="image" src="http://blogs.southworks.net/matiasb/files/2010/11/image_thumb.png" width="485" height="484" /></a></p>
<p>Hope you find it useful!</p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Prism 4.0 First Drop &#8211; MVVM</title>
		<link>http://blogs.southworks.net/matiasb/2010/06/03/prism-40-first-drop-mvvm/</link>
		<comments>http://blogs.southworks.net/matiasb/2010/06/03/prism-40-first-drop-mvvm/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 22:14:59 +0000</pubDate>
		<dc:creator>Matias Bonaventura</dc:creator>
				<category><![CDATA[Composite Application Guidance]]></category>
		<category><![CDATA[Prism]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[patterns and practices]]></category>
		<category><![CDATA[Patterns and Practices]]></category>
		<category><![CDATA[Prism 4.0]]></category>

		<guid isPermaLink="false">http://61.56</guid>
		<description><![CDATA[... <a href="http://blogs.southworks.net/matiasb/2010/06/03/prism-40-first-drop-mvvm/" class="more-link">read more<img src="http://blogs.southworks.net/wp-content/themes/southworks/assets/img/arrow-blue.png" width="12" height="12" alt="" /></a>]]></description>
			<content:encoded><![CDATA[<p><span style="font-size: small">The p&amp;p Team has just released the first drop of Prism 4.0 (previously known as the Composite Application Guidance for WPF and Silverlight). You can download this new version from the <a href="http://compositewpf.codeplex.com/releases/view/46407">codeplex site</a>.</span></p>
<h2>What’s new</h2>
<p><span style="font-size: small">In this first drop, you will find 2 new QuickStarts that tackles two of the main concerns of the community: MEF integration and the MVVM pattern.  In this post I’ll cover the MVVM QuickStarts and leave the MEF QuickStarts for the following post.</span></p>
<h3><span style="font-size: small"><strong>Basic Model-View-ViewModel Quickstart</strong></span></h3>
<p><span style="font-size: small">The BasicMVVM QuickStarts address the most usual challenges when developing MVVM triads. The QuickStarts demonstrate a POCO scenario,  showing a questionnaire with different question types that must be completed. By design, the QuickStarts targets Silverlight only (no WPF  version) and does not use any of the Prism library .</span></p>
<p><span style="font-size: small">(Styling is WIP <img src='http://blogs.southworks.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> )</span></p>
<p><a href="http://blogs.southworks.net/matiasb/files/2010/06/clip-image001.jpg"><img src="http://blogs.southworks.net/matiasb/files/2010/06/clip-image001-thumb.jpg" border="0" alt="clip_image001" width="510" height="413" /></a></p>
<p><span style="font-size: small">Some of the challenges demonstrated in this quickstart are:</span></p>
<ul>
<li><strong><span style="font-size: small">INotifyPropertyChange implementation</span></strong></li>
</ul>
<blockquote><p><span style="font-size: small">Every ViewModel needs to notify the view when its bounded properties change. For that purpose, Silverlight provides the </span><a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.inotifypropertychanged.aspx"><span style="font-size: small">INotifyPropertyChange</span></a><span style="font-size: small"> interface. The QuickStarts provides the ViewModelBase class, a base implementation that provides useful methods for property notification:</span></p></blockquote>
<ul>
<blockquote><p><span style="font-size: small"><span style="font-size: x-small">protected virtual void RaisePropertyChanged(string propertyName); <br />
protected void RaisePropertyChanged(params string[] propertyNames);<br />
protected void RaisePropertyChanged&lt;T&gt;(Expression&lt;Func&lt;T&gt;&gt; propertyExpresssion);</span>    </span></p></blockquote>
</ul>
<blockquote><p><span style="font-size: small">Besides the classic RaisePropertyChaged method that received the name of the property that has changed, it also provides an interesting overload that accepts a lambda expression, which allows to write property notification in the ViewModel as follows:</span></p></blockquote>
<ul>
<blockquote><p><span style="font-size: x-small">this.RaisePropertyChanged(() =&gt; this.Name);</span></p></blockquote>
<li><strong><span style="font-size: small">Validation</span></strong></li>
<p><span style="font-size: small">Another typical challenge is notifying the View when binding errors occur. For that reason, Silverlight provides two interfaces: </span><a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.inotifydataerrorinfo%28VS.95%29.aspx"><span style="font-size: small">INotifyDataErrorInfo</span></a><span style="font-size: small"> and </span><a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.idataerrorinfo.aspx"><span style="font-size: small">IDataErrorInfo</span></a><span style="font-size: small">. The ViewModelBase class provides a base implementation for the INotifyDataErrorInfo that can be leveraged from the ViewModels: </span></p>
<blockquote><p><span style="font-size: x-small">public virtual bool HasErrors;<br />
public virtual IEnumerable GetErrors(string propertyName);<br />
protected void SetError(string propertyName, string error);<br />
protected void SetError&lt;T&gt;(Expression&lt;Func&lt;T&gt;&gt; propertyExpresssion, string error);<br />
protected void ClearErrors(string propertyName);<br />
protected void ClearErrors&lt;T&gt;(Expression&lt;Func&lt;T&gt;&gt; propertyExpresssion);<br />
protected void SetErrors(string propertyName, List&lt;string&gt; propertyErrors);<br />
protected void SetErrors&lt;T&gt;(Expression&lt;Func&lt;T&gt;&gt; propertyExpresssion, List&lt;string&gt; propertyErrors);<br />
protected virtual void RaiseErrorsChanged(string propertyName);<br />
protected virtual void RaiseErrorsChanged&lt;T&gt;(Expression&lt;Func&lt;T&gt;&gt; propertyExpresssion);</span></p></blockquote>
<p><span style="font-size: small">The quickstart demonstrate how the domain model validation is done on the Model (for example the NumericQuestions). Formatting validation is performed on the ViewModels (for example the Age property in the questionnaire) to customize error messages (if you don’t need customization of error messages you can just rely on Silverlight binding errors).</span></p>
<li><strong><span style="font-size: small">Transitions/Animations triggered by the ViewModel</span></strong></li>
</ul>
<blockquote><p><span style="font-size: small">Animations are typically triggered by the UI (e.g. when clicking a button). But some times animations must start based on a change in the ViewModel. The challenge in those cases is how to start the animation when the ViewModel doesn’t have a reference to the View. The quickstart demonstrate how to use Triggers and the VisualStateManager bound to a property in the ViewModel to accomplish that requirement:</span></p></blockquote>
<ul>
<blockquote>
<div id="a19ea85c-b0e3-4b40-ba59-0fbe4530e09d" class="wlWriterEditableSmartContent" style="padding-bottom: 0px;margin: 0px;padding-left: 0px;padding-right: 0px;float: none;padding-top: 0px">
<div style="border: #000080 1px solid;color: #000;font-family: 'Courier New', Courier, Monospace;font-size: 10pt">
<div style="padding: 2px 5px"><span style="color: #0000ff">&lt;</span><span style="color: #a31515">i:Interaction.Triggers</span><span style="color: #0000ff">&gt;</span><br />
<span style="color: #0000ff">    &lt;</span><span style="color: #a31515">ei:DataTrigger</span><span style="color: #0000ff"> </span><span style="color: #ff0000">Binding</span><span style="color: #0000ff">=</span>&#8220;{<span style="color: #0000ff">Binding CurrentState}</span>&#8220;<span style="color: #0000ff"> </span><span style="color: #ff0000">Value</span><span style="color: #0000ff">=</span>&#8220;<span style="color: #0000ff">Normal</span>&#8220;<span style="color: #0000ff">&gt;</span><br />
<span style="color: #0000ff">        &lt;</span><span style="color: #a31515">ei:GoToStateAction</span><span style="color: #0000ff"> </span><span style="color: #ff0000">StateName</span><span style="color: #0000ff">=</span>&#8220;<span style="color: #0000ff">Normal</span>&#8220;<span style="color: #0000ff">/&gt;</span><br />
<span style="color: #0000ff">    &lt;/</span><span style="color: #a31515">ei:DataTrigger</span><span style="color: #0000ff">&gt;</span><br />
<span style="color: #0000ff">    &lt;</span><span style="color: #a31515">ei:DataTrigger</span><span style="color: #0000ff"> </span><span style="color: #ff0000">Binding</span><span style="color: #0000ff">=</span>&#8220;{<span style="color: #0000ff">Binding CurrentState}</span>&#8220;<span style="color: #0000ff"> </span><span style="color: #ff0000">Value</span><span style="color: #0000ff">=</span>&#8220;<span style="color: #0000ff">Submitting</span>&#8220;<span style="color: #0000ff">&gt;</span><br />
<span style="color: #0000ff">        &lt;</span><span style="color: #a31515">ei:GoToStateAction</span><span style="color: #0000ff"> </span><span style="color: #ff0000">StateName</span><span style="color: #0000ff">=</span>&#8220;<span style="color: #0000ff">Submitting</span>&#8220;<span style="color: #0000ff">/&gt;</span><br />
<span style="color: #0000ff">    &lt;/</span><span style="color: #a31515">ei:DataTrigger</span><span style="color: #0000ff">&gt;</span><br />
<span style="color: #0000ff">&lt;/</span><span style="color: #a31515">i:Interaction.Triggers</span><span style="color: #0000ff">&gt;</span></div>
</div>
</div>
<p> </p></blockquote>
<li><strong><span style="font-size: small">Usage of hierarchical ViewModels (ViewModels that contain other ViewModels)</span></strong></li>
</ul>
<blockquote><p><span style="font-size: small">Each of the questions in the questionnaire has their own ViewModel, and the <strong>QuestionnaireViewModel</strong> has a property of type<strong> List&lt;QuestionViewModel&gt; Questions</strong>.  In the <strong>QuestionnaireView</strong>, the questions’ view models are bound  to the corresponding view DataTemplate. This is achieved by the newly developed  <strong>DataTemplateSelector</strong> (WPF provides a mechanisms for doing this out-of-the-box, Silverlight does not.)</span></p>
<div id="34ef388b-fa53-4268-8fac-93b4ee8eeba9" class="wlWriterEditableSmartContent" style="padding-bottom: 0px;margin: 0px;padding-left: 0px;padding-right: 0px;float: none;padding-top: 0px">
<div style="border: #000080 1px solid;color: #000;font-family: 'Courier New', Courier, Monospace;font-size: 10pt">
<div style="padding: 2px 5px"><span style="color: #0000ff">&lt;</span><span style="color: #a31515">ItemsControl.ItemTemplate</span><span style="color: #0000ff">&gt;</span><br />
<span style="color: #0000ff">    &lt;</span><span style="color: #a31515">DataTemplate</span><span style="color: #0000ff">&gt;</span><br />
<span style="color: #0000ff">        &lt;</span><span style="color: #a31515">Infra:DataTemplateSelector</span><span style="color: #0000ff"> </span><span style="color: #ff0000">Content</span><span style="color: #0000ff">=</span>&#8220;{<span style="color: #0000ff">Binding}</span>&#8220;<span style="color: #0000ff"> </span><span style="color: #ff0000">HorizontalContentAlignment</span><span style="color: #0000ff">=</span>&#8220;<span style="color: #0000ff">Stretch</span>&#8220;<span style="color: #0000ff"> </span><span style="color: #ff0000">IsTabStop</span><span style="color: #0000ff">=</span>&#8220;<span style="color: #0000ff">False</span>&#8220;<span style="color: #0000ff">&gt;</span><br />
<span style="color: #0000ff">            &lt;</span><span style="color: #a31515">Infra:DataTemplateSelector.Resources</span><span style="color: #0000ff">&gt;</span><br />
<span style="color: #0000ff">                &lt;</span><span style="color: #a31515">DataTemplate</span><span style="color: #0000ff"> </span><span style="color: #ff0000">x:Key</span><span style="color: #0000ff">=</span>&#8220;<span style="color: #0000ff">OpenQuestionViewModel</span>&#8220;<span style="color: #0000ff">&gt;</span><br />
<span style="color: #0000ff">                    &lt;!&#8211;</span><span style="color: #008000"> View for OpenQuestionViewModel </span><span style="color: #0000ff">&#8211;&gt;</span><br />
<span style="color: #0000ff">                &lt;/</span><span style="color: #a31515">DataTemplate</span><span style="color: #0000ff">&gt;</span></div>
<p><span style="color: #0000ff">                &lt;</span><span style="color: #a31515">DataTemplate</span><span style="color: #0000ff"> </span><span style="color: #ff0000">x:Key</span><span style="color: #0000ff">=</span>&#8220;<span style="color: #0000ff">MultipleSelectionQuestionViewModel</span>&#8220;<span style="color: #0000ff">&gt;</span><br />
<span style="color: #0000ff">                    &lt;!&#8211;</span><span style="color: #008000"> View for MultipleSelectionQuestionViewModel </span><span style="color: #0000ff">&#8211;&gt;</span><br />
<span style="color: #0000ff">                &lt;/</span><span style="color: #a31515">DataTemplate</span><span style="color: #0000ff">&gt;</span><br />
<span style="color: #0000ff">                &lt;</span><span style="color: #a31515">DataTemplate</span><span style="color: #0000ff"> </span><span style="color: #ff0000">x:Key</span><span style="color: #0000ff">=</span>&#8220;<span style="color: #0000ff">NumericQuestionViewModel</span>&#8220;<span style="color: #0000ff">&gt;</span><br />
<span style="color: #0000ff">                    &lt;!&#8211;</span><span style="color: #008000"> View for NumericQuestionViewModel </span><span style="color: #0000ff">&#8211;&gt;</span><br />
<span style="color: #0000ff">                &lt;/</span><span style="color: #a31515">DataTemplate</span><span style="color: #0000ff">&gt;</span><br />
<span style="color: #0000ff">            &lt;/</span><span style="color: #a31515">Infra:DataTemplateSelector.Resources</span><span style="color: #0000ff">&gt;</span><br />
<span style="color: #0000ff">        &lt;/</span><span style="color: #a31515">Infra:DataTemplateSelector</span><span style="color: #0000ff">&gt;</span><br />
<span style="color: #0000ff">    &lt;/</span><span style="color: #a31515">DataTemplate</span><span style="color: #0000ff">&gt;</span><br />
<span style="color: #0000ff">&lt;/</span><span style="color: #a31515">ItemsControl.ItemTemplate</span><span style="color: #0000ff">&gt;</span></p>
</div>
</div>
</blockquote>
<ul> </ul>
<ul>
<li><span style="font-size: small"><strong>Use of Blend Behaviors (Commanding, Data Template Selection, Binding, Validation) </strong></span></li>
</ul>
<blockquote><p><span style="font-size: small">Finally, the quickstart demonstrate the usage of several new Behaviors to simplify the binding between the View and the ViewModel.  Some of these behaviors are:</span></p>
<ul>
<li><span style="font-size: small"><strong>CallExecuteMethod</strong>: This behavior is similar to binding to a command, but removes the need to explicitly instantiate a Command in the ViewModel. You can specify the method to execute and a CanExecute property:</span></li>
</ul>
<p><span style="font-size: small">                       </span><span style="font-size: x-small">  &lt;Behaviors:CallExecuteMethodAction TargetObject=&#8221;{Binding}&#8221; ExecuteMethodName=&#8221;Submit&#8221; CanExecutePropertyName=&#8221;CanSubmit&#8221;/&gt;</span></p>
<ul>
<li><span style="font-size: small"><strong>UpdateTextBindingOnPropertyChanged: </strong>This behavior updates the binding every time the text property changes on a TextBox. This can be done in WPF without out-of-the-box behaviors , but is not available in Silverlight yet.</span></li>
<p>&lt;TextBox Text=&#8221;{Binding ResponseText, Mode=TwoWay, UpdateSourceTrigger=Explicit}&#8221;&gt;<br />
            &lt;i:Interaction.Behaviors&gt;<br />
                &lt;Behaviors:UpdateTextBindingOnPropertyChanged/&gt;<br />
            &lt;/i:Interaction.Behaviors&gt;<br />
&lt;/TextBox&gt;</p>
<li><span style="font-size: small"><strong>ValidateObject: </strong>This behavior updates the ValidationSummary property for the ValidationSummary controls whenever an error occurs on its source.</span></li>
</ul>
<p>         &lt;sdk:ValidationSummary &gt;<br />
            &lt;i:Interaction.Behaviors&gt;<br />
                &lt;Behaviors:ValidateObject SourceObject=&#8221;{Binding}&#8221;/&gt;<br />
            &lt;/i:Interaction.Behaviors&gt;<br />
        &lt;/sdk:ValidationSummary&gt;</p></blockquote>
<blockquote><p><span style="font-size: small">All these leverage Blend’s Behavior&lt;T&gt; class, so they can also be used with drag&amp;drop from Blend. </span></p></blockquote>
<p> </p>
<p><span style="font-size: small">This is the first drop of the new version of prism, so any feedback will be really appreciated from the p&amp;p team and will help improving future drops. Remember to leave your feedback in the <a href="http://compositewpf.codeplex.com/releases/view/46407">codeplex site</a>.</span></p>
<p><a rev="vote-for" href="http://dotnetshoutout.com/Prism-40-First-Drop-MVVM"><img alt="Shout it" src="http://dotnetshoutout.com/image.axd?url=http%3A%2F%2Fblogs.southworks.net%2Fmatiasb%2F2010%2F06%2F03%2Fprism-40-first-drop-mvvm%2F"></a></p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Prism Automation: Templates for implementing the MVVM pattern using the Composite Application Library</title>
		<link>http://blogs.southworks.net/matiasb/2009/08/15/prism-automation-templates-for-implementing-the-mvvm-pattern-using-the-composite-application-library/</link>
		<comments>http://blogs.southworks.net/matiasb/2009/08/15/prism-automation-templates-for-implementing-the-mvvm-pattern-using-the-composite-application-library/#comments</comments>
		<pubDate>Sat, 15 Aug 2009 20:33:24 +0000</pubDate>
		<dc:creator>Matias Bonaventura</dc:creator>
				<category><![CDATA[Composite Application Guidance]]></category>
		<category><![CDATA[Prism]]></category>
		<category><![CDATA[Prism-v2]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[patterns and practices]]></category>
		<category><![CDATA[Automation]]></category>
		<category><![CDATA[Patterns and Practices]]></category>

		<guid isPermaLink="false">http://61.43</guid>
		<description><![CDATA[... <a href="http://blogs.southworks.net/matiasb/2009/08/15/prism-automation-templates-for-implementing-the-mvvm-pattern-using-the-composite-application-library/" class="more-link">read more<img src="http://blogs.southworks.net/wp-content/themes/southworks/assets/img/arrow-blue.png" width="12" height="12" alt="" /></a>]]></description>
			<content:encoded><![CDATA[<p>With the help of <a href="http://blogs.southworks.net/dschenkelman/">Damian Schenkelman</a> and <a href="http://blogs.southworks.net/jdominguez/">Julian Dominguez</a>, we created some <a href="//blogs.southworks.net/matiasb/files/2009/08/prism-mvvm-templates1.zip">Visual Studio Item Templates </a>that provides the basic assets for implementing a new view using the MVVM pattern in <a href="http://msdn.microsoft.com/en-us/library/cc707819.aspx">Prism</a>. These templates create the necessary files and classes for the view and viewModel parts of the pattern.</p>
<p>I will explain in this post how to install and use the Prism MVVM templates. If you are not familiar with the MVVM pattern the following links are a good staring point:</p>
<ul>
<li><a href="http://compositewpf.codeplex.com/Wiki/View.aspx?title=Model%20View%20ViewModel%20%28MVVM%29">Model View ViewModel (MVVM)</a> in the <a href="http://compositewpf.codeplex.com/Wiki/View.aspx?title=Knowledge%20Base">prism Knowledge Base</a>.</li>
<li><a href="http://msdn.microsoft.com/en-us/magazine/dd419663.aspx">WPF Apps With The Model-View-ViewModel Design Pattern</a></li>
<li><a href="http://msdn.microsoft.com/en-us/magazine/dd458800.aspx">Model-View-ViewModel In Silverlight 2 Apps</a></li>
<li><a href="http://blogs.msdn.com/dancre/archive/2006/07/23/676272.aspx">DataModel-View-ViewModel pattern: 1</a></li>
<li><a href="http://www.orbifold.net/default/?p=550">WPF patterns : MVC, MVP or MVVM or…?</a></li>
</ul>
<p>These MVVM templates aim to help you facilitate the creation of <a href="http://msdn.microsoft.com/en-us/library/dd490819.aspx">views with presenters</a> when developing prism applications. Then we disscuss briefly some implementation considetarions.<br />
<a href="http://blogs.msdn.com/dphill/">David Hill</a> has recently posted the <a href="http://blogs.msdn.com/dphill/archive/2009/06/15/prism-quick-start-kit-update.aspx">Prism Quick Start Kit</a> which includes project templates for creating prism <a href="http://msdn.microsoft.com/en-us/library/dd458929.aspx">Modules</a> and <a href="http://msdn.microsoft.com/en-us/library/dd458910.aspx">Shell</a>, both for WPF and Silverlight. <a href="http://blogs.southworks.net/dschenkelman/">Damian</a> has created <a href="http://blogs.southworks.net/dschenkelman/2009/08/13/c-code-snippet-to-create-commands-with-attached-behaviors-using-prism/">code snippets</a> for easing the creation of Commands with attached Behaviors.</p>
<h4>How-To: Install the Prism MVVM Templates</h4>
<p>Installing the templates it&#8217;s really simple!</p>
<ol>
<li><a href="//blogs.southworks.net/matiasb/files/2009/08/prism-mvvm-templates1.zip">Dowloand templates</a> and unzip them into your Visual Studio templates folder. They are C# templates so they go here on my system:<br />
    <strong>My DocumentsVisual Studio 2008TemplatesItemTemplatesVisual C#</strong></li>
<li>To avoid getting a warning message the first time you use them, you can close Visual Studio and run the following command (as admin) in a Visual Studio Command Prompt window:<br />
    <strong>devenv.exe /installvstemplates</strong></li>
</ol>
<p>That&#8217;s all! you should now be able see them in the New Items dialog.</p>
<h4>How-To: Use the Prism MVVM Templates</h4>
<p>Using the templates it&#8217;s also really simple (that&#8217;s the idea of using templates after all <img src='http://blogs.southworks.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ).</p>
<ol>
<li>Open any prism application in Visual Studio. (Templates will work in any kind of application, but you will have to reference CAL assemblies).</li>
<li>Right click on the project/folder where you want to place your new view and select <strong>Add / New Item&#8230;</strong>The New Item Dialog will appear.</li>
<li>Select <strong>Prism MVVM</strong> or <strong>Prism MVVM (with interfaces)</strong> from the My Templates category.<a href="http://blogs.southworks.net/matiasb/files/2009/08/image3.png"><img src="http://blogs.southworks.net/matiasb/files/2009/08/image-thumb3.png" border="0" alt="image" width="644" height="392" /></a></li>
<li>Click <strong>Add.</strong>  This will create the View with xaml and code behind, and the ViewModel. If you selected <strong>Prism MVVM (with interfaces)</strong> template, it will additionally create interfaces for the View and ViewModel (this is highly recommended as it will ease testing).</li>
</ol>
<p><a href="http://blogs.southworks.net/matiasb/files/2009/08/image1.png"><img src="http://blogs.southworks.net/matiasb/files/2009/08/image-thumb1.png" border="0" alt="image" width="349" height="107" /></a></p>
<p>Great, we have now the new view with it&#8217;s corresponding ViewModel.  To show the view you should register it in the appropriate region as usual. For example, using view discovery (if you didn&#8217;t used interfaces, you won&#8217;t need the first line):</p>
<blockquote>
<pre><span style="color: #0000ff">this</span>._container.RegisterType&lt;<span style="color: #2b91af">ICustomersViewModel</span>, <span style="color: #2b91af">CustomersViewModel</span>&gt;();
<span style="color: #0000ff">this</span>._regionManager.RegisterViewWithRegion(RegionNames.ButtomLeftRegion, () =&gt; <span style="color: #0000ff">this</span>._container.Resolve&lt;<span style="color: #2b91af">CustomersView</span>&gt;());</pre>
</blockquote>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>Using the above code in David&#8217;s Quickstart Solution, you can get the view shown:</p>
<p><a href="http://blogs.southworks.net/matiasb/files/2009/08/image4.png"><img src="http://blogs.southworks.net/matiasb/files/2009/08/image-thumb4.png" border="0" alt="image" width="352" height="239" /></a></p>
<h4>Implementation considerations:</h4>
<p>You will notice in the implementation of the view and viewModel that:</p>
<ol>
<li>View-First approach is used.</li>
<li>Templates can be used in WPF and Silverlight prism applications.</li>
<li>The implementation relies on prism, as it inyects the EA to the ViewModel.</li>
<li>A property is created in the viewModel, to demostrate databinding in the view.</li>
</ol>
<p>You can download the templates from <a href="//blogs.southworks.net/matiasb/files/2009/08/prism-mvvm-templates1.zip">here</a>.<br />
<a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fblogs.southworks.net%2fmatiasb%2f2009%2f08%2f15%2fprism-automation-templates-for-implementing-the-mvvm-pattern-using-the-composite-application-library%2f"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fblogs.southworks.net%2fmatiasb%2f2009%2f08%2f15%2fprism-automation-templates-for-implementing-the-mvvm-pattern-using-the-composite-application-library%2f" border="0" alt="kick it on DotNetKicks.com" /></a></p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automation Templates for the Composite Application Library: Prism Quick Start Kit</title>
		<link>http://blogs.southworks.net/matiasb/2009/08/06/automation-templates-for-the-composite-application-library-prism-quick-start-kit/</link>
		<comments>http://blogs.southworks.net/matiasb/2009/08/06/automation-templates-for-the-composite-application-library-prism-quick-start-kit/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 14:36:56 +0000</pubDate>
		<dc:creator>Matias Bonaventura</dc:creator>
				<category><![CDATA[Composite Application Guidance]]></category>
		<category><![CDATA[Prism]]></category>
		<category><![CDATA[Prism-v2]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[patterns and practices]]></category>
		<category><![CDATA[Automation]]></category>
		<category><![CDATA[Patterns and Practices]]></category>

		<guid isPermaLink="false">http://61.36</guid>
		<description><![CDATA[... <a href="http://blogs.southworks.net/matiasb/2009/08/06/automation-templates-for-the-composite-application-library-prism-quick-start-kit/" class="more-link">read more<img src="http://blogs.southworks.net/wp-content/themes/southworks/assets/img/arrow-blue.png" width="12" height="12" alt="" /></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://blogs.msdn.com/dphill/">David Hill</a> (patterns and practices architect) has been working recently on new Visual Studio Templates that provide an excellent starting point for WPF and Silverlight Prism-v2 applications.  This is an experiment on how p&amp;p could provide some level of automation for next versions of prism, so don&#8217;t hesitate to post any comment on David&#8217;s <a href="http://blogs.msdn.com/dphill/archive/2009/06/15/prism-quick-start-kit-update.aspx">post</a>.</p>
<p>You can download and install these templates from David&#8217;s blog:</p>
<ul>
<li><a href="http://blogs.msdn.com/dphill/archive/2009/05/29/prism-quick-start-kit.aspx">Prism Quick Start Kit</a></li>
<li><a href="http://blogs.msdn.com/dphill/archive/2009/06/15/prism-quick-start-kit-update.aspx">Prism Quick Start Kit Update</a></li>
</ul>
<p>The <a href="http://msdn.microsoft.com/en-us/library/dd458809.aspx">Composite Application Guidance for WPF and Silverlight</a> (a.k.a Prism) provides several <a href="http://msdn.microsoft.com/en-us/library/dd458858.aspx">Quickstarts</a> that demonstrate key concepts of the library and the <a href="http://msdn.microsoft.com/en-us/library/dd458919.aspx">Stock Trader Reference Implementation</a> which illustrate a real-world scenario. The Prism Quick Start Kit aims to provide the basic structure for prism projects and solutions, easy to understand and make use of the recommended practices.</p>
<p>The Prism Quick Start Kit comes with quick-start solutions, templates for the Shell and module projects and supports both WPF and Silvelright.</p>
<p><img src="http://blogs.msdn.com/blogfiles/dphill/WindowsLiveWriter/PrismQuickStartKitUpdate_8735/image_2.png" alt="" /></p>
<p>Hope you find them useful!</p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How-to Hide Views inside Composite Application Guidance (aka Prism-v2) regions.</title>
		<link>http://blogs.southworks.net/matiasb/2009/07/02/how-to-hide-views-inside-composite-application-guidance-aka-prism-v2-regions/</link>
		<comments>http://blogs.southworks.net/matiasb/2009/07/02/how-to-hide-views-inside-composite-application-guidance-aka-prism-v2-regions/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 15:21:25 +0000</pubDate>
		<dc:creator>Matias Bonaventura</dc:creator>
				<category><![CDATA[Composite Application Guidance]]></category>
		<category><![CDATA[Prism]]></category>
		<category><![CDATA[Prism-v2]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[patterns and practices]]></category>
		<category><![CDATA[Patterns and Practices]]></category>

		<guid isPermaLink="false">http://61.33</guid>
		<description><![CDATA[... <a href="http://blogs.southworks.net/matiasb/2009/07/02/how-to-hide-views-inside-composite-application-guidance-aka-prism-v2-regions/" class="more-link">read more<img src="http://blogs.southworks.net/wp-content/themes/southworks/assets/img/arrow-blue.png" width="12" height="12" alt="" /></a>]]></description>
			<content:encoded><![CDATA[<p>The <strong>IRegion</strong> interface allows to Add/Remove and Activate/Deactivate the views contained in the region. These two sets of actions let us manipulate the state of each view in regions. While the meaning of Add/Remove is clear, the semantics of Activate/Deactivate might be confusing as it greatly depends on the concrete implementation of <strong>IRegion</strong>.</p>
<p><strong><span style="text-decoration: underline">Activate semantic by concrete region implementation (between brackets is the type of control attached to by default):</span></strong></p>
<ul>
<li><strong>SingleActiveRegion (ContentControl):</strong> There is a maximum of one active region at a time. This means that activating a view might trigger a deactivation of another view.<br />
If the region is created with the default adapter (<strong>ContentControlRegionAdapter</strong>) the active view will also be only one visible, as it is set as the content of the ContentControl.</li>
<li><strong>AllActiveRegion (ItemsControl):</strong> All views that are kept in the region are active. Calling Deactivate on a view will throw an InvalidOperationException. All views are usually visible.</li>
<li><strong>Region (Selector): </strong>This region allows for multiple active and deactive views.<br />
If created with the default adapter (<strong>SelectorRegionAdapter</strong>) the active views will be kept in sync with the SelectedItem/SelectedItems of the control. So when calling Activate on a view, you can only select a single active view at a time. By setting the SelectedItems property of a listbox, you can set multiple views to active. All views (active and deactive) are visible.</li>
</ul>
<p>The <strong>RegionActiveAwareBehavior </strong>and the <strong>IActiveAware</strong> interface are very close related to the activate semantic. So for example, even if the IActiveAware interface is implemented in a view, if it is contained in an <strong>AllActiveRegion</strong>, the view will only be notified of the active state change only once (when added to the region).</p>
<h2>Hiding views</h2>
<p>Activating and deactivating views is usually confused with it&#8217;s visibility. If you deactivate a view, it will only hide it if the region is a SingleActiveRegion. It will throw an exception in AllActiveRegions and it will not hide the view in Regions.</p>
<p>The posibility of hiding views while keeping the view in the region is not implemented out-of-the-box in prism-v2. Hiding view only makes sense in <strong>ItemsControl</strong> containers, as in other containers views are automatically hidden when they are not active. Hiding views might be particularly helpful, for example if there is a requirement to hide certain <strong>TabItems</strong> (as deactivating the view won&#8217;t hide the tab, and setting <strong>Visibility=Hidden</strong> in the view won&#8217;t hide the tab).</p>
<p>With Damian Schenkelman, we created the following two classes (one for Silverlight and one for WPF) that add extension methods to allow hide/show views in prism-v2 regions (Download links below). WPF methods implements hide/show for all <strong>ItemsControl </strong>containers while Silverlight methods are only implemented for the <strong>TabControl</strong>.</p>
<blockquote><p>· <strong>SilverlightRegionExtensions</strong> (allow hide views in <strong>TabControl</strong> regions)</p>
<p>· <strong>WPFRegionExtensions</strong> (allow hide views in <strong>ItemsControl</strong> regions)</p></blockquote>
<p>The aforementioned classes expose the following extension methods for the <strong>IRegion</strong> interface:</p>
<blockquote><p>· <strong>Hide(string viewName</strong>): Hides a view registered with a particular name in the region.</p>
<p>· <strong>Hide(object view):</strong> Hides the view passed as a parameter.</p>
<p>· <strong>Show(string viewName):</strong> Shows a view registered with a particular name in the region.</p>
<p>· <strong>Show(object view):</strong> Shows the view passed as a parameter.</p></blockquote>
<p>We also created a sample application to show it&#8217;s usage and to highlight the difference betwen Add/Remove, Activate/Deactivate, Hide/Show.<br />
<a href="http://blogs.southworks.net/matiasb/files/2009/07/image.png"><img src="http://blogs.southworks.net/matiasb/files/2009/07/image-thumb.png" border="0" alt="image" width="284" height="255" /></a></p>
<p>You can play with it selecting the tab checkboxes and pressing the action buttons.</p>
<p> </p>
<h2>Download</h2>
<p>We uploaded the WPF and silverlight region extension method to the <a href="http://compositewpf.codeplex.com/">Prism codeplex site</a>. You can get these classes from <a href="http://compositewpf.codeplex.com/">RegionExtensions.zip</a>.</p>
<p>You can also downloaded the sample application from <a href="http://blogs.southworks.net/matiasb/files/2009/07/hideviewssample.zip">Hide Views Sample</a> .<br />
<a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fblogs.southworks.net%2fmatiasb%2f2009%2f07%2f02%2fhow-to-hide-views-inside-composite-application-guidance-aka-prism-v2-regions%2f"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fblogs.southworks.net%2fmatiasb%2f2009%2f07%2f02%2fhow-to-hide-views-inside-composite-application-guidance-aka-prism-v2-regions%2f" border="0" alt="kick it on DotNetKicks.com" /></a></p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How-to: Consume WCF services from Composite Application Guidance for WPF and Silverlight(Prism-v2) Modules</title>
		<link>http://blogs.southworks.net/matiasb/2009/06/20/how-to-consume-wcf-services-from-composite-application-guidance-for-wpf-and-silverlightprism-v2-modules/</link>
		<comments>http://blogs.southworks.net/matiasb/2009/06/20/how-to-consume-wcf-services-from-composite-application-guidance-for-wpf-and-silverlightprism-v2-modules/#comments</comments>
		<pubDate>Sat, 20 Jun 2009 05:03:25 +0000</pubDate>
		<dc:creator>Matias Bonaventura</dc:creator>
				<category><![CDATA[Composite Application Guidance]]></category>
		<category><![CDATA[Prism]]></category>
		<category><![CDATA[Prism-v2]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[WebBrowser Control]]></category>
		<category><![CDATA[patterns and practices]]></category>
		<category><![CDATA[Patterns and Practices]]></category>
		<category><![CDATA[WebBrowser]]></category>

		<guid isPermaLink="false">http://61.30</guid>
		<description><![CDATA[... <a href="http://blogs.southworks.net/matiasb/2009/06/20/how-to-consume-wcf-services-from-composite-application-guidance-for-wpf-and-silverlightprism-v2-modules/" class="more-link">read more<img src="http://blogs.southworks.net/wp-content/themes/southworks/assets/img/arrow-blue.png" width="12" height="12" alt="" /></a>]]></description>
			<content:encoded><![CDATA[<div id="b203eda6-a1b2-40ad-91cb-386d527e99a6" class="wlWriterSmartContent" style="padding-right: 0px;padding-left: 0px;padding-bottom: 0px;margin: 0px;padding-top: 0px">Yesterday, while developing a <a href="http://blogs.southworks.net/dschenkelman/2009/06/23/webbrowser-control-quickstart-for-the-composite-application-guidance-for-wpf-and-silverlight-prism-v2/">demo app </a>that uses <a href="http://msdn.microsoft.com/en-us/library/dd458809.aspx">Prism-v2</a>, <a href="http://msdn.microsoft.com/en-us/library/ms735119.aspx">WCF services</a>, <a href="http://msdn.microsoft.com/en-us/asp.net/default.aspx">ASP.NET</a> web application and interaction with <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.aspx">WebBrowser controls</a> ,  I run into a little problem trying to consume the service from a module.  I thought could be useful posting about it to save someone a little time.</div>
<div class="wlWriterSmartContent" style="padding-right: 0px;padding-left: 0px;padding-bottom: 0px;margin: 0px;padding-top: 0px"><strong>Update: </strong><a href="http://blogs.southworks.net/dschenkelman">Damian Schenkelman </a>has posted <a href="http://blogs.southworks.net/dschenkelman/2009/06/23/webbrowser-control-quickstart-for-the-composite-application-guidance-for-wpf-and-silverlight-prism-v2/">WebBrowser control Quickstart for the Composite Application Guidance for WPF and Silverlight (Prism-v2</a>) where you can find and download the demo.</div>
<h3>The Problem</h3>
<p>I had a WCF service in place. It was working fine with a ASP.NET web app, but when I tried to cunsume it from a Prism-v2 module I got the following exception:</p>
<p><em>&#8216;System.InvalidOperationException: Could not find default endpoint element that references contract &#8216;CustomerService.ICustomerService&#8217; in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.</em></p>
<p align="center"><a href="http://blogs.southworks.net/matiasb/files/2009/06/image.png"><img src="http://blogs.southworks.net/matiasb/files/2009/06/image-thumb.png" border="0" alt="image" width="397" height="97" /></a></p>
<p>I was using the <strong>app.config </strong>that was generated by the WCF &#8220;add service reference&#8221; wizard. I checked it&#8217;s content but everything was fine.</p>
<h3>The solution</h3>
<p><strong>Move the app.confing to the Shell project!</strong><br />
In prism modules are loaded dynamically, so they all run in the Shell project context. WCF was not finding my app.config because it was not in the right place.</p>
<p align="center"><a href="http://blogs.southworks.net/matiasb/files/2009/06/image1.png"><img src="http://blogs.southworks.net/matiasb/files/2009/06/image-thumb1.png" border="0" alt="image" width="163" height="273" /></a></p>
<p align="center"> </p>
<p style="text-align: left">This will do for simple applications, but most general application already have an app.config with settings. On the other hand, modules should be completely decoupled from the shell. A good way to resolve these issues is to set WCF configuration within the module programatically.</p>
<p align="left">I hope this is useful when consuming WCF Services from Prism Modules.<br />
 </p>
<p><a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fblogs.southworks.net%2fmatiasb%2f2009%2f06%2f20%2fhow-to-consume-wcf-services-from-composite-application-guidance-for-wpf-and-silverlightprism-v2-modules%2f"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fblogs.southworks.net%2fmatiasb%2f2009%2f06%2f20%2fhow-to-consume-wcf-services-from-composite-application-guidance-for-wpf-and-silverlightprism-v2-modules%2f" border="0" alt="kick it on DotNetKicks.com" /></a></p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Composite Application Guidance for WPF (Prism) documentation in multiple formats</title>
		<link>http://blogs.southworks.net/mszklanny/2008/12/20/composite-application-guidance-for-wpf-prism-documentation-in-japanese/</link>
		<comments>http://blogs.southworks.net/mszklanny/2008/12/20/composite-application-guidance-for-wpf-prism-documentation-in-japanese/#comments</comments>
		<pubDate>Sat, 20 Dec 2008 22:39:23 +0000</pubDate>
		<dc:creator>Mariano Szklanny</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[Documentation]]></category>
		<category><![CDATA[Prism]]></category>
		<category><![CDATA[patterns and practices]]></category>

		<guid isPermaLink="false">http://42.191</guid>
		<description><![CDATA[... <a href="http://blogs.southworks.net/mszklanny/2008/12/20/composite-application-guidance-for-wpf-prism-documentation-in-japanese/" class="more-link">read more<img src="http://blogs.southworks.net/wp-content/themes/southworks/assets/img/arrow-blue.png" width="12" height="12" alt="" /></a>]]></description>
			<content:encoded><![CDATA[<p>Back in July, I <a href="http://blogs.southworks.net/mszklanny/2008/07/09/composite-guidance-for-wpf-documentation-and-hands-on-lab/">posted</a> about the documentation shipped with the first release of the <a href="http://www.microsoft.com/compositewpf">Composite Application Guidance for WPF</a> (aka Prism). Some months ago, the docs have been presented in book format:</p>
<p style="text-align: center"><img class="aligncenter size-full wp-image-192" src="http://blogs.southworks.net/mszklanny/files/2008/12/prismbook.jpg" alt="" width="250" height="305" /><br />
(<a href="http://blogs.southworks.net/dpoza/2008/10/31/composite-application-guidance-for-wpf-prism-v1-book-released/">more details</a> | <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=e3e87bdc-fec1-4489-91fa-e1cf69721563">PDF version</a>)</p>
<p>Recently, I have been notified that the <a href="http://msdn.microsoft.com/ja-jp/library/dd365013.aspx" target="_blank">Japanese version</a> is also available:<br />
<img class="aligncenter size-full wp-image-193" src="http://blogs.southworks.net/mszklanny/files/2008/12/prismjapanese.png"><br />
This is great news &#8211; way to go patterns &amp; practices team!</p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Composite Guidance for WPF Documentation and Hands On Lab</title>
		<link>http://blogs.southworks.net/mszklanny/2008/07/09/composite-guidance-for-wpf-documentation-and-hands-on-lab/</link>
		<comments>http://blogs.southworks.net/mszklanny/2008/07/09/composite-guidance-for-wpf-documentation-and-hands-on-lab/#comments</comments>
		<pubDate>Wed, 09 Jul 2008 17:15:46 +0000</pubDate>
		<dc:creator>Mariano Szklanny</dc:creator>
				<category><![CDATA[Documentation]]></category>
		<category><![CDATA[Prism]]></category>
		<category><![CDATA[Smart Clients]]></category>
		<category><![CDATA[patterns and practices]]></category>

		<guid isPermaLink="false">http://42.180</guid>
		<description><![CDATA[... <a href="http://blogs.southworks.net/mszklanny/2008/07/09/composite-guidance-for-wpf-documentation-and-hands-on-lab/" class="more-link">read more<img src="http://blogs.southworks.net/wp-content/themes/southworks/assets/img/arrow-blue.png" width="12" height="12" alt="" /></a>]]></description>
			<content:encoded><![CDATA[<p>As you may already now, the <a href="http://msdn.microsoft.com/en-us/library/cc707819.aspx" target="_blank">Composite Application Guidance for WPF</a> was released a few days ago. In this project I had the pleasure of working with the <a href="http://msdn.microsoft.com/en-us/practices/default.aspx" target="_blank">patterns &amp; practices</a> team, mainly as a technical writer. (I wrote a few lines of code too, but nothing compared to the huge job done by devs!)</p>
<h3>Hands On Lab for free</h3>
<p>One of the things I want to highlight is that, apart from having 300 printed pages (!), the documentation includes a <a href="http://msdn.microsoft.com/en-us/library/cc707878.aspx" target="_blank">Hands on Lab</a>. What I like about Hands on Labs is that they provide a guided and integrated learning process through practical exercises surrounded by background technical content.</p>
<p>The Lab is quite hidden in the table of contents; you can find it under the node <a href="http://msdn.microsoft.com/en-us/library/cc707878.aspx" target="_blank">Composite Application Guidance for WPF Hands On Lab</a> in the table of contents.<a href="http://blogs.southworks.net/mszklanny/files/2008/07/toc.png"><img src="http://blogs.southworks.net/mszklanny/files/2008/07/toc-thumb.png" border="0" alt="ToC" width="354" height="199" /></a></p>
<h4>Covered Topics</h4>
<p>This lab covers the basic concepts of the Composite Application Guidance for WPF as you build a simple Hello World application. The following is a list of questions we tried to address:</p>
<ul>
<li>What an application based on the Composite Application Library is</li>
<li>What are the Composite Application Library assemblies, what they contain</li>
<li>What is the Shell project and the Shell window</li>
<li>What is the Bootstrapper, and what is the UnityBootstrapper class and how it is used</li>
<li>What is a container and how it relates to the dependency injection pattern</li>
<li>What is a service</li>
<li>What is a region</li>
<li>What type of regions are supported out-of-the-box by the Composite Application Library</li>
<li>What is a module</li>
<li>What is the module initializer class</li>
<li>What folders a module typically contains</li>
<li>What are the different ways of loading modules</li>
<li>What is the StaticModuleEnumerator class and how it is used</li>
<li>What is a view</li>
<li>What is the Region manager and how to use it to add views and named views</li>
</ul>
<h4>Topics not Covered</h4>
<p>To keep the Lab simple (and to ship on time!), we consciously kept some topics out of the Lab. However, you can find information about those topics across the documentation. The following list presents some of the topics not covered in the Lab and links to related resources:</p>
<ul>
<li><a href="http://msdn.microsoft.com/en-us/library/cc707894.aspx" target="_blank">Commands</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/cc707894.aspx" target="_blank">Decoupled Events</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/cc707834.aspx" target="_blank">How to dynamically load modules</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/cc707863.aspx" target="_blank">Scoped Regions</a>.</li>
<li><a href="http://msdn.microsoft.com/en-us/library/cc707885.aspx" target="_blank">Presentation Model</a> and <a href="http://msdn.microsoft.com/en-us/library/cc707873.aspx" target="_blank">Supervising Controller</a> patterns</li>
<li>How to unit test an application based on the Composite Application Library. See the source code in the <a href="http://msdn.microsoft.com/en-us/library/cc707869.aspx" target="_blank">Stock Trader Reference Implementation</a> or in the <a href="http://msdn.microsoft.com/en-us/library/cc707865.aspx" target="_blank">QuickStarts</a>.</li>
</ul>
<h3>Feedback Welcome</h3>
<p>We didn&#8217;t include Hands On Labs in previous deliverables like the <a href="http://www.msdn.com/smartclientfactory" target="_blank">Smart Client Software Factory</a> and the <a href="http://www.msdn.com/webclientfactory" target="_blank">Web Client Software Factory</a>, so we are experimenting a new approach here (we did released Hands on Lab as separate downloads some time after the official releases, though). I personally think that including a Hands On Lab within the initial package will help users with the learning process and adoption, but I&#8217;m excited about reading your comments.</p>
<p>Do you like the lab? Is it useful? Would you recommend it to your colleagues and/or customers? It is great to receive feedback like <a href="http://davidhayden.com/blog/dave/archive/2008/07/05/CompositeApplicationGuidanceWPFDocumentationIntroduction.aspx" target="_blank">this</a>, but negative feedback is welcome too!</p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Prism Team</title>
		<link>http://blogs.southworks.net/mszklanny/2008/04/28/prism-team/</link>
		<comments>http://blogs.southworks.net/mszklanny/2008/04/28/prism-team/#comments</comments>
		<pubDate>Mon, 28 Apr 2008 02:42:00 +0000</pubDate>
		<dc:creator>Mariano Szklanny</dc:creator>
				<category><![CDATA[Prism]]></category>
		<category><![CDATA[patterns and practices]]></category>

		<guid isPermaLink="false">http://42.88</guid>
		<description><![CDATA[... <a href="http://blogs.southworks.net/mszklanny/2008/04/28/prism-team/" class="more-link">read more<img src="http://blogs.southworks.net/wp-content/themes/southworks/assets/img/arrow-blue.png" width="12" height="12" alt="" /></a>]]></description>
			<content:encoded><![CDATA[<p>Want to see how we work at Prism? Don&#8217;t miss <a href="http://codebetter.com/blogs/glenn.block/archive/2008/04/27/the-prism-team-and-how-we-develop.aspx" target="_blank">this great post</a> from <a href="http://codebetter.com/blogs/glenn.block/default.aspx" target="_blank">Glenn</a>. He describes the team, how we work, what being at the team room feels, and he also shows pictures of the (distributed) team and includes videos that show how we do iteration planning.</p>
<p><a href="http://blogs.southworks.net/mszklanny/files/2008/06/prismteam1-2.jpg"><img height="139" alt="Prism Team 1_2" src="http://blogs.southworks.net/mszklanny/files/2008/06/prismteam1-2-thumb.jpg" width="184" border="0" /></a>&#160;<a href="http://blogs.southworks.net/mszklanny/files/2008/06/prismteam2-4.jpg"><img height="139" alt="Prism Team 2_4" src="http://blogs.southworks.net/mszklanny/files/2008/06/prismteam2-4-thumb.jpg" width="184" border="0" /></a>     <br /><a href="http://blogs.southworks.net/mszklanny/files/2008/06/prismteam3-4.jpg"><img height="138" alt="Prism Team 3_4" src="http://blogs.southworks.net/mszklanny/files/2008/06/prismteam3-4-thumb.jpg" width="183" border="0" /></a> </p>
<p><strong>The Prism team.</strong>    <br /><em>1st picture: Redmond, WA, USA. 2nd picture: Buenos Aires, Argentina. 3rd picture: India</em></p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Smart Client Software Factory v2 shipped!</title>
		<link>http://blogs.southworks.net/mszklanny/2007/05/19/smart-client-software-factory-v2-shipped/</link>
		<comments>http://blogs.southworks.net/mszklanny/2007/05/19/smart-client-software-factory-v2-shipped/#comments</comments>
		<pubDate>Sat, 19 May 2007 20:08:20 +0000</pubDate>
		<dc:creator>Mariano Szklanny</dc:creator>
				<category><![CDATA[SCSF]]></category>
		<category><![CDATA[Smart Clients]]></category>
		<category><![CDATA[patterns and practices]]></category>

		<guid isPermaLink="false">http://42.78</guid>
		<description><![CDATA[... <a href="http://blogs.southworks.net/mszklanny/2007/05/19/smart-client-software-factory-v2-shipped/" class="more-link">read more<img src="http://blogs.southworks.net/wp-content/themes/southworks/assets/img/arrow-blue.png" width="12" height="12" alt="" /></a>]]></description>
			<content:encoded><![CDATA[<p>Yes! We finally shipped it! It took us a little more time than what we expected but I&#8217;m very excited about the new features and capabilities we are providing to the community. This release provides (from <a href="http://blogs.msdn.com/blaine/archive/2007/05/19/smart-client-software-factory-may-2007-release-is-live.aspx">Blaine&#8217;s announcement post</a>):</p>
<blockquote><ul>
<li><em>Windows Presentation Foundation interoperability CAB extensions&#160; and View with presenter recipe (</em>don&#8217;t miss <a href="http://staff.southworks.net/blogs/msaez/archive/2007/04/29/WPF-Support-in-SCSF.aspx">this post</a> from <a href="http://staff.southworks.net/msaez">Miguel Saez</a> for more details<em>)</em> </li>
<li><em>Offline application blocks and recipes; the application blocks support asynchronous calls to WCF web services. </em></li>
<li><em>Richer ClickOnce Deployment capabilities </em></li>
<li><em>Enhanced guidance packages which includes code generation Visual Basic .NET 2005 </em>(don&#8217;t miss <a href="http://staff.southworks.net/blogs/jarguello/archive/2007/03/22/Smart-Client-Guidance-development.aspx">this post</a> from <a href="http://staff.southworks.net/blogs/jarguello/default.aspx">Juan Arguello</a> for more details) </li>
<li><em>Improved installation with a new dependency checker</em> </li>
</ul>
</blockquote>
<p>You can get it from the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=2B6A10F9-8410-4F13-AD53-05A202FBDB63&amp;displaylang=en">Microsoft Downloads Center</a>.</p>
<p>One of the things we added at the very end of the project, is a QuickStart that demonstrates how to integrate the Disconnected Service Agent (DSA) and the Connection Monitor (CM) Application Blocks with a Composite UI Application Block application. Although we had to postpone a little bit the release date to include this QuickStart, we strongly believe that it will help you better understand how to consume these blocks from your smart client application.</p>
<p><strong>The Offline Application Blocks demonstrated in the QuickStart</strong></p>
<p>In just a few words (see the Help for detailed information), the <strong>Disconnected Service Agent Application Block</strong> allows you to invoke web services asynchronously from occasionally connected smart clients. This means that you can, for example, enqueue a request while the application is offline and have it automatically dispatched by the block when connectivity is detected. When the request is dispatched, a callback will be invoked for your application to process the response.</p>
<p>The <strong>Connection Monitor Application Block</strong> basically monitors connectivity status. As a developer, you can define what set of services you need to reach from your smart client application and the block will notify you whenever changes in the client&#8217;s computer affect the ability to reach those services.</p>
<p><strong>Overview</strong></p>
<p>The QuickStart basically shows a master-details view. The Shell form displays a list of restaurants in the left and their corresponding menu items in the right. To retrieve the data (restaurants and menu items lists), a WCF service is consumed:</p>
<p><a href="http://blogs.southworks.net/mszklanny/files/2008/06/dsa-cab-qs-1.png"><img height="274" alt="DSA_CAB_QS_1" src="http://blogs.southworks.net/mszklanny/files/2008/06/dsa-cab-qs-1-thumb.png" width="450" border="0" /></a> </p>
<p>If you launch the QuickStart without having an Internet connection available, the application will enqueue the request that will retrieve the restaurants list, and will display an Offline status indicator.</p>
<p><a href="http://blogs.southworks.net/mszklanny/files/2008/06/dsa-cab-qs-2.png"><img height="351" alt="DSA_CAB_QS_2" src="http://blogs.southworks.net/mszklanny/files/2008/06/dsa-cab-qs-2-thumb.png" width="450" border="0" /></a> </p>
<p>As soon as you go online, the restaurants list will be loaded and the connectivity status indicator will be updated:</p>
<p><a href="http://blogs.southworks.net/mszklanny/files/2008/06/compositeuiapplicationblockwithdisconnectedserviceagentquickstart.png"><img height="251" alt="CompositeUI Application Block with Disconnected Service Agent QuickStart" src="http://blogs.southworks.net/mszklanny/files/2008/06/compositeuiapplicationblockwithdisconnectedserviceagentquickstart-thumb.png" width="450" border="0" /></a> </p>
<p>If you click a restaurant, you will see the menu items list loaded in the right. But if the Internet connection was dropped, you will see a message saying that you must be online to retrieve the menu items list:</p>
<p><a href="http://blogs.southworks.net/mszklanny/files/2008/06/dsa-cab-qs-3.png"><img height="352" alt="DSA_CAB_QS_3" src="http://blogs.southworks.net/mszklanny/files/2008/06/dsa-cab-qs-3-thumb.png" width="450" border="0" /></a> </p>
<p>Now suppose you go online again, but the web service now is failing or has been shut down (you can close the WCF host to test this scenario). The application will handle the error and ask the user to try again later:</p>
<p><a href="http://blogs.southworks.net/mszklanny/files/2008/06/dsa-cab-qs-4.png"><img height="351" alt="DSA_CAB_QS_4" src="http://blogs.southworks.net/mszklanny/files/2008/06/dsa-cab-qs-4-thumb.png" width="450" border="0" /></a> </p>
<p>Retrieving data from a remote service is an expensive task and might take a while. Therefore the QuickStart displays a progress bar when a call to a the web service is performed:</p>
<p><a href="http://blogs.southworks.net/mszklanny/files/2008/06/dsa-cab-qs-5.png"><img height="348" alt="DSA_CAB_QS_5" src="http://blogs.southworks.net/mszklanny/files/2008/06/dsa-cab-qs-5-thumb.png" width="449" border="0" /></a> </p>
<p><strong>What can I do next?</strong></p>
<p><a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=2B6A10F9-8410-4F13-AD53-05A202FBDB63&amp;displaylang=en">Download the factory</a> and start playing with it! <img src='http://blogs.southworks.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
