<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Jaime Rodriguez  : mvvm</title><link>http://blogs.msdn.com/jaimer/archive/tags/mvvm/default.aspx</link><description>Tags: mvvm</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>THANKS CHICAGO. Here is the content.</title><link>http://blogs.msdn.com/jaimer/archive/2009/06/16/thanks-chicago-here-is-the-content.aspx</link><pubDate>Wed, 17 Jun 2009 09:56:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9767163</guid><dc:creator>jaimer</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/jaimer/comments/9767163.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jaimer/commentrss.aspx?PostID=9767163</wfw:commentRss><description>&lt;p&gt;Last friday, we had the pleasure of delivering the last stop in the WPF for LOB tour: Chicago. &lt;a href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/THANKSCHICAGO.Hereisthecontent_15095/ChicagoXamlized_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="ChicagoXamlized" border="0" alt="ChicagoXamlized" align="right" src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/THANKSCHICAGO.Hereisthecontent_15095/ChicagoXamlized_thumb.jpg" width="192" height="317" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The training was very lively, with lots of people from all over the mid-west, and a few people from other further places…&amp;#160; It was a lot of fun at a good location (despite a shaky start with a microphone, that only lasted 45 mins ).&amp;#160; Definitely a good way to finish the tour..    &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;The content for Chicago is now posted:&amp;#160; &lt;a href="http://www.cookingwithxaml.com/content/ChicagoLob/decks.zip" target="_blank"&gt;Decks&lt;/a&gt;&amp;#160; and &lt;a href="http://www.cookingwithxaml.com/content/ChicagoLob/demos.zip" target="_blank"&gt;demos&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Thanks to all the Chicago attendees!! &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;And thanks to every one else who helped us with the tour.&amp;#160; This has been a lot of fun and very enlightening and inspiring to us.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9767163" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jaimer/archive/tags/Windows+Presentation+Foundation/default.aspx">Windows Presentation Foundation</category><category domain="http://blogs.msdn.com/jaimer/archive/tags/mvvm/default.aspx">mvvm</category></item><item><title>two very promising WPF application frameworks on codeplex</title><link>http://blogs.msdn.com/jaimer/archive/2009/03/02/two-very-promising-wpf-application-frameworks-on-codeplex.aspx</link><pubDate>Tue, 03 Mar 2009 09:08:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9455992</guid><dc:creator>jaimer</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/jaimer/comments/9455992.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jaimer/commentrss.aspx?PostID=9455992</wfw:commentRss><description>&lt;P&gt;Catching up on my blog reading, I see two great development frameworks recently posted in Codeplex. Both aim to build clean, testable, loosely coupled WPF applications with separated concerns.&amp;nbsp; &lt;A href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/twoverypromisingWPFframeworksoncodeplex_129E1/gift_4.png" mce_href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/twoverypromisingWPFframeworksoncodeplex_129E1/gift_4.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; MARGIN: 0px 0px 0px 5px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=gift border=0 alt=gift align=right src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/twoverypromisingWPFframeworksoncodeplex_129E1/gift_thumb_1.png" width=157 height=156 mce_src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/twoverypromisingWPFframeworksoncodeplex_129E1/gift_thumb_1.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://www.codeplex.com/wpfonyx" target=_blank mce_href="http://www.codeplex.com/wpfonyx"&gt;“&lt;STRONG&gt;Onyx&lt;/STRONG&gt;&lt;/A&gt; is a framework that aids in the development of WPF applications that follow the Model-View-ViewModel (MVVM) pattern”, by &lt;A href="http://wekempf.spaces.live.com/blog/" target=_blank mce_href="http://wekempf.spaces.live.com/blog/"&gt;Bill Kempf&lt;/A&gt; &lt;BR&gt;&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;"Designed to aid in the development of WPF and Silverlight applications, &lt;A href="http://caliburn.codeplex.com/" target=_blank mce_href="http://caliburn.codeplex.com/"&gt;&lt;STRONG&gt;Caliburn&lt;/STRONG&gt;&lt;/A&gt; implements a variety of UI patterns for solving real-world problems. Patterns that are enabled by the framework include MVC, MVP, Presentation Model (MVVM), Commands and Application Controller” , by &lt;A href="http://devlicio.us/blogs/rob_eisenberg/archive/2009/02/26/the-caliburn-beta-is-live.aspx" target=_blank mce_href="http://devlicio.us/blogs/rob_eisenberg/archive/2009/02/26/the-caliburn-beta-is-live.aspx"&gt;Rob Eisenberg&lt;/A&gt;&amp;nbsp; &lt;/LI&gt;&lt;/UL&gt;Check them out, share your feedback, use them, join and contribute (if you rejoice in that kinda thing)! &lt;BR&gt;
&lt;P&gt;I am really looking forward to diving into these and to see where the community takes them! &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9455992" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jaimer/archive/tags/Windows+Presentation+Foundation/default.aspx">Windows Presentation Foundation</category><category domain="http://blogs.msdn.com/jaimer/archive/tags/mvvm/default.aspx">mvvm</category></item><item><title>M-V-VM training day sample application and decks</title><link>http://blogs.msdn.com/jaimer/archive/2009/02/10/m-v-vm-training-day-sample-application-and-decks.aspx</link><pubDate>Tue, 10 Feb 2009 12:21:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9410185</guid><dc:creator>jaimer</dc:creator><slash:comments>14</slash:comments><comments>http://blogs.msdn.com/jaimer/comments/9410185.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jaimer/commentrss.aspx?PostID=9410185</wfw:commentRss><description>&lt;p&gt;During the M-V-VM training (last saturday) with &lt;a href="http://karlshifflett.wordpress.com/" mce_href="http://karlshifflett.wordpress.com/" target="_blank"&gt;Karl Shifflett&lt;/a&gt; I showed and referred often to this Southridge application below..     &lt;br&gt;The app is not very clean(when it comes to resources and styles in particular) but it is a fairly good ViewModel example, and it served well to illustrate a few of the points we made at the training (both good and bad practices).&amp;nbsp; So I am sharing it (as promised).&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;    &lt;br&gt;The application consists of three views sharing one ViewModel around real-estate data (called MainViewModel).     &lt;br&gt;    &lt;br&gt;The application's chrome includes a ribbon that drives all the Viewmodel via its filtering functionality.&amp;nbsp; The two filter commands that work are Bathrooms and bedrooms [if you change the selection for these, the results on the views should filter]. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/MVVMtrainingdaysampleapplicationanddecks_14BDA/image_4.png" mce_href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/MVVMtrainingdaysampleapplicationanddecks_14BDA/image_4.png"&gt;&lt;img src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/MVVMtrainingdaysampleapplicationanddecks_14BDA/image_thumb_1.png" style="border-width: 0px;" alt="image" mce_src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/MVVMtrainingdaysampleapplicationanddecks_14BDA/image_thumb_1.png" width="780" border="0" height="133"&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt;  &lt;p&gt;I purposedly did not make the main window with the ribbon a view because I often run into applications that transition views so I wanted to show the concept of having a constant element in the chrome.&amp;nbsp;&amp;nbsp; The ribbon is functional ( you can see its resize behavior). &lt;br&gt;The checkbox columns are bound to the MainViewModel, and drive the columns that show up in the Search view (below).    &lt;br&gt;    &lt;br&gt;&lt;b&gt;The views&lt;br&gt;&lt;/b&gt;Again, the views are the results for the search from the criteria in the ribbon.&amp;nbsp; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/MVVMtrainingdaysampleapplicationanddecks_14BDA/image_6.png" mce_href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/MVVMtrainingdaysampleapplicationanddecks_14BDA/image_6.png"&gt;&lt;img src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/MVVMtrainingdaysampleapplicationanddecks_14BDA/image_thumb_2.png" style="border-width: 0px;" alt="image" mce_src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/MVVMtrainingdaysampleapplicationanddecks_14BDA/image_thumb_2.png" width="387" border="0" height="239"&gt;&lt;/a&gt; &lt;a href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/MVVMtrainingdaysampleapplicationanddecks_14BDA/image_8.png" mce_href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/MVVMtrainingdaysampleapplicationanddecks_14BDA/image_8.png"&gt;&lt;img src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/MVVMtrainingdaysampleapplicationanddecks_14BDA/image_thumb_3.png" style="border-width: 0px;" alt="image" mce_src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/MVVMtrainingdaysampleapplicationanddecks_14BDA/image_thumb_3.png" width="368" border="0" height="236"&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Both of these views are 100% XAML.&amp;nbsp; &lt;/p&gt;  &lt;p&gt;The grid is very functional, sort, selection, etc.&amp;nbsp;&amp;nbsp; I call it SearchView. &lt;br&gt;The map is simply a Listbox with a datatemplate and a tooltip on the ListBoxItems. I need to add more to that UI.&amp;nbsp;    I call it the MapView :) &lt;br&gt;You navigate to the map view, by either clicking on the map icon on the left hand side of any row of the data grid, or by clicking on the Map Ribbon button on the Search Results tab.&amp;nbsp; &lt;br&gt;The full details of course include an OpenMap Command exposed in the MainViewModel that does the work.     &lt;br&gt;    &lt;br&gt;To go back to SearchView (from any view), just click on the Search tabs, and it automatically goes back.&amp;nbsp; The way that happens is through an attached behavior in the RibbonTab: &lt;br&gt;&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;r&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;RibbonTab &lt;/span&gt;&lt;span style="color: red;"&gt;Name&lt;/span&gt;&lt;span style="color: blue;"&gt;="SearchTab" &lt;/span&gt;&lt;span style="color: red;"&gt;Label&lt;/span&gt;&lt;span style="color: blue;"&gt;="Search Criteria" &lt;/span&gt;&lt;span style="color: red;"&gt;view&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;RibbonTabSelectedBehavior.SelectionChanged&lt;/span&gt;&lt;span style="color: blue;"&gt;="{&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;Binding &lt;/span&gt;&lt;span style="color: red;"&gt;SearchSelectedCommand&lt;/span&gt;&lt;span style="color: blue;"&gt;}" &lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;&lt;a href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;This is a standard attached behavior that delegates the event and 'forwards' it the SearchSelectedCommand on the MainViewModel.&amp;nbsp; You can see the implementation on the RibbonTabSelectedBehavior class. &lt;/p&gt;

&lt;p&gt;
  &lt;br&gt;There is another totally different View, called Profile..&amp;nbsp; &lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/MVVMtrainingdaysampleapplicationanddecks_14BDA/image_10.png" mce_href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/MVVMtrainingdaysampleapplicationanddecks_14BDA/image_10.png"&gt;&lt;img src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/MVVMtrainingdaysampleapplicationanddecks_14BDA/image_thumb_4.png" style="border-width: 0px;" alt="image" mce_src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/MVVMtrainingdaysampleapplicationanddecks_14BDA/image_thumb_4.png" width="401" align="left" border="0" height="333"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This view demonstrates data validation using IDataErrorInfo. It has an InfoTextBox (from Kevin Moore's bag-o-tricks) and shows the fields that are invalid in red. &lt;/p&gt;

&lt;p&gt;The validation is trivial, mostly checks for empty strings on all fields, except zipcode, around ZipCode it enforces the 5 digits or 9 digits with a dash format for US Zipcodes. &lt;/p&gt;

&lt;p&gt;[For details, check the Profile class] in XMLData project. ] &lt;/p&gt;

&lt;p&gt;You can see how the "Save Profile" command is wired to only be enabled when the data is valid. &lt;/p&gt;

&lt;p&gt;The Profile view purposedly contains a "PreferencesEditor" usercontrol that is not a view itself; it takes data context and drives its UI from it, but does not have full view functionality (again to illustrate a point: not every thing is a view). &lt;/p&gt;

&lt;p&gt;The profile window has both a DataTemplate ( for everything in "Contact information").&amp;nbsp; &lt;br&gt;

  &lt;br&gt;The listboxes in Location are interesting because they State is populated with read-only data (I call it meta-data) that is not coming from the view model,&amp;nbsp; but the views are bound to the Viewmodel when selection happens (county is driven by the selection on State).&amp;nbsp;&amp;nbsp; Be aware that the data is not big and some states (e.g. CA) might not have valid data. Try WA to see it the way I see it. &lt;/p&gt;



&lt;p&gt;&amp;nbsp; &lt;br&gt;&lt;/p&gt;

&lt;p&gt;The final screen is the Listing Details screen. This is a modal window that shows Listing details. Nothing too exciting here but it is a wired view model, including the Make appointment button. You may notice that the "Neighborhood" data template in this view is the exact same data template from the Tooltip on the map.&amp;nbsp;&amp;nbsp; yes, I am lazy and I drive reuse, that is why viewmodel is my friend. &lt;br&gt;&lt;/p&gt;

&lt;p&gt;The Listbox has a very "view specific" behavior implemented by 3 lines of code behind, it is used to implement selection when mouse ente&lt;a href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/MVVMtrainingdaysampleapplicationanddecks_14BDA/image_12.png" mce_href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/MVVMtrainingdaysampleapplicationanddecks_14BDA/image_12.png"&gt;&lt;img src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/MVVMtrainingdaysampleapplicationanddecks_14BDA/image_thumb_5.png" style="border-width: 0px;" alt="image" mce_src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/MVVMtrainingdaysampleapplicationanddecks_14BDA/image_thumb_5.png" width="402" align="right" border="0" height="261"&gt;&lt;/a&gt;rs a listboxitem. I purposedly left it as is, though I am sure some M-V-VM purist will tell me I should have implemented it as an attached behavior. I chose not to because I did not want the viewmodel to manipulate the view on a quirk like this one. The view can self-contain the behavior and yes, if I try to move the code to Silverlight it will need the same 3 liner. I was OK with that.&amp;nbsp; I felt it was equally bad to have the ViewModel be listening for view events and "manipulate the view" directly (which I would have needed). 

  &lt;br&gt;

  &lt;br&gt;At last, there is one class that keeps it all together, I called it the ViewManager. This is an over-simplistic implementation of a Presenter for the views that handles transitions across the views.&amp;nbsp; The views register with the viewmanager as they are instantiated, and the ViewModel can trigger call into the ViewManager ( a singleton) of course to trigger transitions across views. The viewManager itself can have a ViewModel if needed; in this case I did not use it, but in other apps I have used it. &lt;/p&gt;

&lt;p&gt;That is it, if you were at the class I hope you remember this.&amp;nbsp; If you were not, then maybe looking at the deck might help, though I must say the class was quite driven by example, so the slides are a bit presentation-zen-like. Please try the notes for a bit more context and drop me a comment or email if that is not cutting it. &lt;/p&gt;

&lt;p&gt;At last, &lt;b&gt;thanks to all those that attended the class.&amp;nbsp; It was a lot of fun, and I really enjoyed meeting all of you&lt;/b&gt;. 

  &lt;br&gt;Thanks also to Matthias &amp;amp; Bruno &amp;amp; Karl for puttting it together and for inviting me.&amp;nbsp; &lt;/p&gt;

&lt;p&gt;Presentation (ppt deck) is &lt;a href="http://www.cookingwithxaml.com/meals/southridge/decknotes.pptx" mce_href="http://www.cookingwithxaml.com/meals/southridge/decknotes.pptx" target="_blank"&gt;here&lt;/a&gt;.&amp;nbsp;&amp;nbsp; Code is &lt;a href="http://www.cookingwithxaml.com/meals/southridge/southridge.zip" mce_href="http://www.cookingwithxaml.com/meals/southridge/southridge.zip" target="_blank"&gt;here&lt;/a&gt;.&amp;nbsp; The code requires the WPF toolkit, all assemblies needed should be included in the project but if you get a compilation error, try getting the toolkit and the ribbon from &lt;a href="http://www.codeplex.com/wpf" mce_href="http://www.codeplex.com/wpf" target="_blank"&gt;codeplex&lt;/a&gt; 

  &lt;br&gt;

  &lt;br&gt;[Disclaimer again, the code needs some heavy scrubbing on the UI and resources; also I had to take out the data that I normally use, so if you see #if SQLCE, simply ignore these.&amp;nbsp; I replaced all the data with an XML file (for easy tweaking). It is not real data, so don't be surprised when you see a Seatttle address in an Issaquah neighborhood.&amp;nbsp; I merely invented the data on the fly]. &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9410185" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jaimer/archive/tags/Windows+Presentation+Foundation/default.aspx">Windows Presentation Foundation</category><category domain="http://blogs.msdn.com/jaimer/archive/tags/mvvm/default.aspx">mvvm</category></item></channel></rss>