<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Better User and Developer Experiences &#8211; From Windows Forms to WPF with MVVM: Part 7, MVVM</title>
	<atom:link href="http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/feed/" rel="self" type="application/rss+xml" />
	<link>http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/</link>
	<description>Thoughts on C#, WPF, .NET, and programming for Scientific Visualization</description>
	<lastBuildDate>Fri, 11 May 2012 16:07:35 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: James</title>
		<link>http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-2159</link>
		<dc:creator>James</dc:creator>
		<pubDate>Fri, 11 May 2012 16:07:35 +0000</pubDate>
		<guid isPermaLink="false">http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-2159</guid>
		<description>Just read this great series as I wanted to try and start using WPF properly, I pretty much started by copying my Windows Form app, which works, but doesn&#039;t quite seem right - this has definitely helped me rethink my app.</description>
		<content:encoded><![CDATA[<p>Just read this great series as I wanted to try and start using WPF properly, I pretty much started by copying my Windows Form app, which works, but doesn&#8217;t quite seem right &#8211; this has definitely helped me rethink my app.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob</title>
		<link>http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-1876</link>
		<dc:creator>Rob</dc:creator>
		<pubDate>Fri, 18 Nov 2011 22:47:56 +0000</pubDate>
		<guid isPermaLink="false">http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-1876</guid>
		<description>In MainView.xaml, you bind the browser to the URI property of the MainViewModel and you update the value of the URI whenever the FeedViewModel_PropertyChanged event fires.  This results in the Feed URI text control at the top of the window also updating.  This doesn&#039;t really cause a problem unless the Load RSS Feed button is pressed again without typing in another URI.

What is the proper/best way to fix this?  I believe you could add a CurrentItemURI property to the MainViewModel class and update and bind to that instead of the URI property.  Alternatively, you could bind to FeedViewModel.SelectedFeedItem.Link (and not update the URI property).

Thanks,

Rob</description>
		<content:encoded><![CDATA[<p>In MainView.xaml, you bind the browser to the URI property of the MainViewModel and you update the value of the URI whenever the FeedViewModel_PropertyChanged event fires.  This results in the Feed URI text control at the top of the window also updating.  This doesn&#8217;t really cause a problem unless the Load RSS Feed button is pressed again without typing in another URI.</p>
<p>What is the proper/best way to fix this?  I believe you could add a CurrentItemURI property to the MainViewModel class and update and bind to that instead of the URI property.  Alternatively, you could bind to FeedViewModel.SelectedFeedItem.Link (and not update the URI property).</p>
<p>Thanks,</p>
<p>Rob</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Reed</title>
		<link>http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-1856</link>
		<dc:creator>Reed</dc:creator>
		<pubDate>Mon, 31 Oct 2011 16:36:47 +0000</pubDate>
		<guid isPermaLink="false">http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-1856</guid>
		<description>In that case, the Model is your service - basically, the service reference you&#039;d add would be your Model, the ViewModel would be the &quot;glue&quot; that wraps it up for your Xaml, and the View would be the Xaml and similar.

As for MVVM being an architectural pattern, that&#039;s pretty well established.  Even look at Wikipedia: http://en.wikipedia.org/wiki/Model_View_ViewModel ...</description>
		<content:encoded><![CDATA[<p>In that case, the Model is your service &#8211; basically, the service reference you&#8217;d add would be your Model, the ViewModel would be the &#8220;glue&#8221; that wraps it up for your Xaml, and the View would be the Xaml and similar.</p>
<p>As for MVVM being an architectural pattern, that&#8217;s pretty well established.  Even look at Wikipedia: <a href="http://en.wikipedia.org/wiki/Model_View_ViewModel" rel="nofollow">http://en.wikipedia.org/wiki/Model_View_ViewModel</a> &#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rohit</title>
		<link>http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-1854</link>
		<dc:creator>Rohit</dc:creator>
		<pubDate>Mon, 31 Oct 2011 02:46:54 +0000</pubDate>
		<guid isPermaLink="false">http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-1854</guid>
		<description>Thanks Reed, but I am not 100% comfortable when you mention MVVM is architectural pattern, how would you articulate a MVVM design where the business logic sits behind a service (SOA), in that case what is model representing?.
Just to be sure I have asked this question on stackoverflow http://stackoverflow.com/questions/7946041/the-model-in-mvvm and found a link discussing something similar.
http://stackoverflow.com/questions/7474267/mvc3-and-entity-framework/7474357#7474357

Thanks</description>
		<content:encoded><![CDATA[<p>Thanks Reed, but I am not 100% comfortable when you mention MVVM is architectural pattern, how would you articulate a MVVM design where the business logic sits behind a service (SOA), in that case what is model representing?.<br />
Just to be sure I have asked this question on stackoverflow <a href="http://stackoverflow.com/questions/7946041/the-model-in-mvvm" rel="nofollow">http://stackoverflow.com/questions/7946041/the-model-in-mvvm</a> and found a link discussing something similar.<br />
<a href="http://stackoverflow.com/questions/7474267/mvc3-and-entity-framework/7474357#7474357" rel="nofollow">http://stackoverflow.com/questions/7474267/mvc3-and-entity-framework/7474357#7474357</a></p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Reed</title>
		<link>http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-1853</link>
		<dc:creator>Reed</dc:creator>
		<pubDate>Sun, 30 Oct 2011 17:16:45 +0000</pubDate>
		<guid isPermaLink="false">http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-1853</guid>
		<description>Rohit,

MVVM is not just about the presentation layer - it&#039;s the overall architectural pattern.

The &quot;Model&quot; in MVVM is the same core model that&#039;s holding your domain/business logic.  The ViewModel is where you&#039;d put any application specific bridge code that&#039;s required.  It&#039;s purpose is to take your Model and expose it to your presentation layer (View).

One of the main goals with MVVM is to keep the &quot;Model&quot; pure - you should be able to use your direct business logic and domain data without change.  The ViewModel is where you place the code required to adapt your model for presentation.

-Reed</description>
		<content:encoded><![CDATA[<p>Rohit,</p>
<p>MVVM is not just about the presentation layer &#8211; it&#8217;s the overall architectural pattern.</p>
<p>The &#8220;Model&#8221; in MVVM is the same core model that&#8217;s holding your domain/business logic.  The ViewModel is where you&#8217;d put any application specific bridge code that&#8217;s required.  It&#8217;s purpose is to take your Model and expose it to your presentation layer (View).</p>
<p>One of the main goals with MVVM is to keep the &#8220;Model&#8221; pure &#8211; you should be able to use your direct business logic and domain data without change.  The ViewModel is where you place the code required to adapt your model for presentation.</p>
<p>-Reed</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rohit</title>
		<link>http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-1852</link>
		<dc:creator>Rohit</dc:creator>
		<pubDate>Sun, 30 Oct 2011 15:49:33 +0000</pubDate>
		<guid isPermaLink="false">http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-1852</guid>
		<description>First of all thanks for writing the series, I really enjoy reading your post especially on TPL.
One question that came to my mind after reading this series is - MVVM is a pattern used in Presentation Layer right?, so model in MVVM in it&#039;s entirety is not exactly the core that holds domain/business-logic, rather there must exist a dotted line from this model in MVVM to the business layer. Can you please shed some light on this? 

Best Regards,
Rohit</description>
		<content:encoded><![CDATA[<p>First of all thanks for writing the series, I really enjoy reading your post especially on TPL.<br />
One question that came to my mind after reading this series is &#8211; MVVM is a pattern used in Presentation Layer right?, so model in MVVM in it&#8217;s entirety is not exactly the core that holds domain/business-logic, rather there must exist a dotted line from this model in MVVM to the business layer. Can you please shed some light on this? </p>
<p>Best Regards,<br />
Rohit</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill</title>
		<link>http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-1848</link>
		<dc:creator>Bill</dc:creator>
		<pubDate>Thu, 27 Oct 2011 19:45:07 +0000</pubDate>
		<guid isPermaLink="false">http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-1848</guid>
		<description>Thanks for your thoughts, Reed.  I think I&#039;ll wait for the &quot;next&quot; Development Model that handles both situations.  IMO, MVVM has a gaping hole.</description>
		<content:encoded><![CDATA[<p>Thanks for your thoughts, Reed.  I think I&#8217;ll wait for the &#8220;next&#8221; Development Model that handles both situations.  IMO, MVVM has a gaping hole.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Reed</title>
		<link>http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-1847</link>
		<dc:creator>Reed</dc:creator>
		<pubDate>Thu, 27 Oct 2011 18:01:16 +0000</pubDate>
		<guid isPermaLink="false">http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-1847</guid>
		<description>Bill,  the way I would think of it is this:

If you&#039;re working on code that interacts with your business logic, and is specific to your application at hand, MVVM is appropriate.

If you&#039;re making a reusable control that&#039;s intended to be used within the View layer from &lt;em&gt;any&lt;/em&gt; application, your code is really &quot;pure View&quot; related, and MVVM doesn&#039;t really apply.  In this case, there is no Model, which means a ViewModel doesn&#039;t make sense (its purpose is to bridge between the View layer and your Model).  

The same is true in Windows Forms - When writing a custom control, you don&#039;t necessarily think in terms of architectural patterns like MVP, but rather making a single, reusable component.</description>
		<content:encoded><![CDATA[<p>Bill,  the way I would think of it is this:</p>
<p>If you&#8217;re working on code that interacts with your business logic, and is specific to your application at hand, MVVM is appropriate.</p>
<p>If you&#8217;re making a reusable control that&#8217;s intended to be used within the View layer from <em>any</em> application, your code is really &#8220;pure View&#8221; related, and MVVM doesn&#8217;t really apply.  In this case, there is no Model, which means a ViewModel doesn&#8217;t make sense (its purpose is to bridge between the View layer and your Model).  </p>
<p>The same is true in Windows Forms &#8211; When writing a custom control, you don&#8217;t necessarily think in terms of architectural patterns like MVP, but rather making a single, reusable component.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill</title>
		<link>http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-1846</link>
		<dc:creator>Bill</dc:creator>
		<pubDate>Thu, 27 Oct 2011 15:40:33 +0000</pubDate>
		<guid isPermaLink="false">http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-1846</guid>
		<description>What&#039;s the difference between &quot;View&quot; and &quot;Pure View&quot;? Are my Pure View coders not my View Coders?</description>
		<content:encoded><![CDATA[<p>What&#8217;s the difference between &#8220;View&#8221; and &#8220;Pure View&#8221;? Are my Pure View coders not my View Coders?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill</title>
		<link>http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-1842</link>
		<dc:creator>Bill</dc:creator>
		<pubDate>Wed, 26 Oct 2011 18:16:01 +0000</pubDate>
		<guid isPermaLink="false">http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-1842</guid>
		<description>Okay, so my &quot;View&quot; team of developers is writing what my customers see (the GUI stuff which, of course, includes controls).  But they&#039;re not doing what the first &quot;V&quot; in MVVM stands for.  They&#039;re &quot;completely outside&quot; of that.  Got it.  Wow.

Only Microsoft could have come up with such a Unified Model that makes so much sense.</description>
		<content:encoded><![CDATA[<p>Okay, so my &#8220;View&#8221; team of developers is writing what my customers see (the GUI stuff which, of course, includes controls).  But they&#8217;re not doing what the first &#8220;V&#8221; in MVVM stands for.  They&#8217;re &#8220;completely outside&#8221; of that.  Got it.  Wow.</p>
<p>Only Microsoft could have come up with such a Unified Model that makes so much sense.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Reed</title>
		<link>http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-1832</link>
		<dc:creator>Reed</dc:creator>
		<pubDate>Wed, 19 Oct 2011 21:27:53 +0000</pubDate>
		<guid isPermaLink="false">http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-1832</guid>
		<description>Bill,

When making your Gauge control, you really shouldn&#039;t be thinking MVVM - it doesn&#039;t apply when writing a control, as you&#039;re writing pure view code.  I&#039;d use code behind here - I wouldn&#039;t do IValueConverters for writing a control, but rather reusable ones for writing an *application that uses the control*.  When writing a control, you&#039;re pure View, and you&#039;re really completely outside of where MVVM applies...

-Reed</description>
		<content:encoded><![CDATA[<p>Bill,</p>
<p>When making your Gauge control, you really shouldn&#8217;t be thinking MVVM &#8211; it doesn&#8217;t apply when writing a control, as you&#8217;re writing pure view code.  I&#8217;d use code behind here &#8211; I wouldn&#8217;t do IValueConverters for writing a control, but rather reusable ones for writing an *application that uses the control*.  When writing a control, you&#8217;re pure View, and you&#8217;re really completely outside of where MVVM applies&#8230;</p>
<p>-Reed</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill</title>
		<link>http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-1830</link>
		<dc:creator>Bill</dc:creator>
		<pubDate>Mon, 17 Oct 2011 20:50:43 +0000</pubDate>
		<guid isPermaLink="false">http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-1830</guid>
		<description>Of course the gauge control is 100% View - it&#039;s GUI stuff.  My point was having to do most of it in code and not XAML, when MVVM says the &quot;View&quot; stuff is supposed to be done in declarative XAML.

Also, implementing 50 or more IValueConverters, once again in code, proves cumbersome to say the least, when doing all these calculations in a loop in one method, say on a ControlLoaded event, seems the most efficient implementation.  Never mind easier to follow and maintain.  (I also don&#039;t see any way of looping in XAML.  For example, draw a Border &#039;n&#039; times).

So what exactly &quot;fits&quot; the MVVM model here when 95% of doing this GUI is in code?  How is declaring the View (GUI stuff) in XAML supposed to make these things easier for a development team?

--Bill</description>
		<content:encoded><![CDATA[<p>Of course the gauge control is 100% View &#8211; it&#8217;s GUI stuff.  My point was having to do most of it in code and not XAML, when MVVM says the &#8220;View&#8221; stuff is supposed to be done in declarative XAML.</p>
<p>Also, implementing 50 or more IValueConverters, once again in code, proves cumbersome to say the least, when doing all these calculations in a loop in one method, say on a ControlLoaded event, seems the most efficient implementation.  Never mind easier to follow and maintain.  (I also don&#8217;t see any way of looping in XAML.  For example, draw a Border &#8216;n&#8217; times).</p>
<p>So what exactly &#8220;fits&#8221; the MVVM model here when 95% of doing this GUI is in code?  How is declaring the View (GUI stuff) in XAML supposed to make these things easier for a development team?</p>
<p>&#8211;Bill</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Reed</title>
		<link>http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-1829</link>
		<dc:creator>Reed</dc:creator>
		<pubDate>Sat, 15 Oct 2011 16:29:41 +0000</pubDate>
		<guid isPermaLink="false">http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-1829</guid>
		<description>Bill,

There are actually two issues here.

For the first - the gauge control - I&#039;d actually argue that this, being a control, is entirely, 100% View.  Custom controls really fall outside of the realm of MVVM entirely, as they&#039;re a resource that will be used later to implement the View in MVVM.  I would, personally, actually use code behind to implement a custom control such as this, as it&#039;s far simpler than trying to separate this out in many cases.

Now - your second - the sizing situations example.  This, to me, seems like a perfect case for a custom IValueConverter.  The advatange here is you can make a converter to handle sizing, and reuse the converter in XAML with various values (ie: different sizing ratios) whenever needed.  

In my opinion, this fits in MVVM perfectly - you&#039;re writing code, but the code is a reusable block of code (unrelated to your domain/application specifically) that can be reused as needed throughout your application.  The code isn&#039;t &quot;domain specific logic&quot;, but rather some additional functionality that can be used by any View, in any application.

-Reed</description>
		<content:encoded><![CDATA[<p>Bill,</p>
<p>There are actually two issues here.</p>
<p>For the first &#8211; the gauge control &#8211; I&#8217;d actually argue that this, being a control, is entirely, 100% View.  Custom controls really fall outside of the realm of MVVM entirely, as they&#8217;re a resource that will be used later to implement the View in MVVM.  I would, personally, actually use code behind to implement a custom control such as this, as it&#8217;s far simpler than trying to separate this out in many cases.</p>
<p>Now &#8211; your second &#8211; the sizing situations example.  This, to me, seems like a perfect case for a custom IValueConverter.  The advatange here is you can make a converter to handle sizing, and reuse the converter in XAML with various values (ie: different sizing ratios) whenever needed.  </p>
<p>In my opinion, this fits in MVVM perfectly &#8211; you&#8217;re writing code, but the code is a reusable block of code (unrelated to your domain/application specifically) that can be reused as needed throughout your application.  The code isn&#8217;t &#8220;domain specific logic&#8221;, but rather some additional functionality that can be used by any View, in any application.</p>
<p>-Reed</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill</title>
		<link>http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-1816</link>
		<dc:creator>Bill</dc:creator>
		<pubDate>Fri, 07 Oct 2011 01:33:48 +0000</pubDate>
		<guid isPermaLink="false">http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-1816</guid>
		<description>This is a great series on WPF and migrating from WinForms.  But I&#039;m still having trouble not doing GUI in code-behind.

Take a simple Circular Gauge Control I made in Silverlight (dstechlabs.com/cc).  The font sizes I choose are directly proportional to the Diameter (DependencyProperty) of the gauge.  And the placement of other child components are also mathematically related to Diameter.  And if I use IConverters for all these placements, then I&#039;m doing these calculations in code anyway, not XAML.

Also, the short and long ticks at the edge of the gauge are made by looping thru angles and using trig functions to get their endpoints.  Also, the number of ticks (the step size between angles) is proportional to Diameter.

There just seems to be too many situations where sizing decisions can&#039;t be made in XAML.  For example,  suppose I want a TextBox to be 3 times the width of the text rendered in a TextBlock.  I don&#039;t know this size until it&#039;s rendered.

I guess I&#039;m missing something in my understanding of WPF&#039;s View.
Thanks for shedding any light on this for me.

--Bill Daniels</description>
		<content:encoded><![CDATA[<p>This is a great series on WPF and migrating from WinForms.  But I&#8217;m still having trouble not doing GUI in code-behind.</p>
<p>Take a simple Circular Gauge Control I made in Silverlight (dstechlabs.com/cc).  The font sizes I choose are directly proportional to the Diameter (DependencyProperty) of the gauge.  And the placement of other child components are also mathematically related to Diameter.  And if I use IConverters for all these placements, then I&#8217;m doing these calculations in code anyway, not XAML.</p>
<p>Also, the short and long ticks at the edge of the gauge are made by looping thru angles and using trig functions to get their endpoints.  Also, the number of ticks (the step size between angles) is proportional to Diameter.</p>
<p>There just seems to be too many situations where sizing decisions can&#8217;t be made in XAML.  For example,  suppose I want a TextBox to be 3 times the width of the text rendered in a TextBlock.  I don&#8217;t know this size until it&#8217;s rendered.</p>
<p>I guess I&#8217;m missing something in my understanding of WPF&#8217;s View.<br />
Thanks for shedding any light on this for me.</p>
<p>&#8211;Bill Daniels</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Reed</title>
		<link>http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-1192</link>
		<dc:creator>Reed</dc:creator>
		<pubDate>Mon, 08 Nov 2010 23:16:10 +0000</pubDate>
		<guid isPermaLink="false">http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-1192</guid>
		<description>Kate,

I haven&#039;t blogged much about MEF + MVVM, other than this: http://reedcopsey.com/2010/03/26/mef-compositioninitializer-for-wpf/

That being said, most posts that are about Silverlight apply to WPF as well.

-Reed</description>
		<content:encoded><![CDATA[<p>Kate,</p>
<p>I haven&#8217;t blogged much about MEF + MVVM, other than this: <a href="http://reedcopsey.com/2010/03/26/mef-compositioninitializer-for-wpf/" rel="nofollow">http://reedcopsey.com/2010/03/26/mef-compositioninitializer-for-wpf/</a></p>
<p>That being said, most posts that are about Silverlight apply to WPF as well.</p>
<p>-Reed</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kate</title>
		<link>http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-1191</link>
		<dc:creator>Kate</dc:creator>
		<pubDate>Mon, 08 Nov 2010 22:57:09 +0000</pubDate>
		<guid isPermaLink="false">http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-1191</guid>
		<description>Hello Reed,

Excellent work! As a beginner I was looking for some good tutorial on WPF-MVVM and stumled upon your blog....lucky me!! Your series really helped me in understanding basic concept of this framework and architecture pattern. 

One question: Do you have similar series/example for using MEF with a WPF-MVVM application? If so it would be really greate if you can share!

Keep up the good work!!</description>
		<content:encoded><![CDATA[<p>Hello Reed,</p>
<p>Excellent work! As a beginner I was looking for some good tutorial on WPF-MVVM and stumled upon your blog&#8230;.lucky me!! Your series really helped me in understanding basic concept of this framework and architecture pattern. </p>
<p>One question: Do you have similar series/example for using MEF with a WPF-MVVM application? If so it would be really greate if you can share!</p>
<p>Keep up the good work!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zamesking</title>
		<link>http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-786</link>
		<dc:creator>zamesking</dc:creator>
		<pubDate>Sun, 28 Feb 2010 01:45:48 +0000</pubDate>
		<guid isPermaLink="false">http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-786</guid>
		<description>Reed,

Thanks for the reply, but I can not open the link in my country. Would you please copy the text, and send it to my mail box?</description>
		<content:encoded><![CDATA[<p>Reed,</p>
<p>Thanks for the reply, but I can not open the link in my country. Would you please copy the text, and send it to my mail box?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Reed</title>
		<link>http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-780</link>
		<dc:creator>Reed</dc:creator>
		<pubDate>Sat, 27 Feb 2010 20:23:41 +0000</pubDate>
		<guid isPermaLink="false">http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-780</guid>
		<description>zamesking,

Here&#039;s an article describing one approach.  Using SelectedItems is tricky, though.

http://bit.ly/alNF72

-Reed</description>
		<content:encoded><![CDATA[<p>zamesking,</p>
<p>Here&#8217;s an article describing one approach.  Using SelectedItems is tricky, though.</p>
<p><a href="http://bit.ly/alNF72" rel="nofollow">http://bit.ly/alNF72</a></p>
<p>-Reed</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zamesking</title>
		<link>http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-775</link>
		<dc:creator>zamesking</dc:creator>
		<pubDate>Sat, 27 Feb 2010 02:45:15 +0000</pubDate>
		<guid isPermaLink="false">http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-775</guid>
		<description>Great stuff, I got time to read your mvvm articles after my vocation. reed, I got a problem at hand now, I can not find an elegant solution for how to two-way bind the selectedItems in ListBox to the datasource in my viewmodel. Did you have any suggestions?</description>
		<content:encoded><![CDATA[<p>Great stuff, I got time to read your mvvm articles after my vocation. reed, I got a problem at hand now, I can not find an elegant solution for how to two-way bind the selectedItems in ListBox to the datasource in my viewmodel. Did you have any suggestions?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Better User and Developer Experiences &#8211; From Windows Forms to WPF with MVVM: Conclusion : Reed Copsey, Jr.</title>
		<link>http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-480</link>
		<dc:creator>Better User and Developer Experiences &#8211; From Windows Forms to WPF with MVVM: Conclusion : Reed Copsey, Jr.</dc:creator>
		<pubDate>Thu, 07 Jan 2010 22:17:07 +0000</pubDate>
		<guid isPermaLink="false">http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-480</guid>
		<description>[...] Windows Presentation Foundation provides us with new opportunities to build applications that are very flexible to design, easy to maintain, and clear to understand.&#160; By taking advantage of Data Binding, Commands, and Templating, we can rethink the way we build our applications, and design them using the Model-View-ViewModel Pattern. [...]</description>
		<content:encoded><![CDATA[<p>[...] Windows Presentation Foundation provides us with new opportunities to build applications that are very flexible to design, easy to maintain, and clear to understand.&#160; By taking advantage of Data Binding, Commands, and Templating, we can rethink the way we build our applications, and design them using the Model-View-ViewModel Pattern. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert</title>
		<link>http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-478</link>
		<dc:creator>Robert</dc:creator>
		<pubDate>Thu, 07 Jan 2010 18:06:12 +0000</pubDate>
		<guid isPermaLink="false">http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-478</guid>
		<description>Thanks Reed, this has been an outstanding series of articles on a subject I find quite fascinating. I&#039;ll be following along for more.</description>
		<content:encoded><![CDATA[<p>Thanks Reed, this has been an outstanding series of articles on a subject I find quite fascinating. I&#8217;ll be following along for more.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Reed</title>
		<link>http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-477</link>
		<dc:creator>Reed</dc:creator>
		<pubDate>Thu, 07 Jan 2010 17:10:57 +0000</pubDate>
		<guid isPermaLink="false">http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-477</guid>
		<description>Pete,

Very good point re: Silverlight vs. WPF.  I definitely see how the limitations in Silverlight, especially prior to SL 4, would make it so having View related code is &quot;less bad&quot; than the alternative hoops you&#039;d have to jump through to avoid it.  

Mostly, my goal here was to get people coming from Windows Forms (ie: writing desktop apps) to think differently, so I&#039;m really focused on WPF over Silverlight.  I&#039;m trying to explain the why behind the pattern, as well as what specifically makes it work in WPF.  It&#039;s something I feel has been lacking in all of the (very excellent) MVVM articles I&#039;ve read to date...  For a Windows Forms developer, putting code in the code behind is natural - trying to break that habit is probably the most important hurdle to jump through in moving to WPF, in my opinion.

Thanks for the feedback!  I really appreciate it.

-Reed</description>
		<content:encoded><![CDATA[<p>Pete,</p>
<p>Very good point re: Silverlight vs. WPF.  I definitely see how the limitations in Silverlight, especially prior to SL 4, would make it so having View related code is &#8220;less bad&#8221; than the alternative hoops you&#8217;d have to jump through to avoid it.  </p>
<p>Mostly, my goal here was to get people coming from Windows Forms (ie: writing desktop apps) to think differently, so I&#8217;m really focused on WPF over Silverlight.  I&#8217;m trying to explain the why behind the pattern, as well as what specifically makes it work in WPF.  It&#8217;s something I feel has been lacking in all of the (very excellent) MVVM articles I&#8217;ve read to date&#8230;  For a Windows Forms developer, putting code in the code behind is natural &#8211; trying to break that habit is probably the most important hurdle to jump through in moving to WPF, in my opinion.</p>
<p>Thanks for the feedback!  I really appreciate it.</p>
<p>-Reed</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pete</title>
		<link>http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-476</link>
		<dc:creator>Pete</dc:creator>
		<pubDate>Thu, 07 Jan 2010 17:02:46 +0000</pubDate>
		<guid isPermaLink="false">http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-476</guid>
		<description>Thanks Reed. I appreciate the clarification. 

I love this series, BTW.

On file dialog: One test I have mentally for what belongs in a viewmodel is &quot;if I changed view technology, would it still apply&quot;. I agree that a services is probably a better approach there.

Many Silverlight folks look to WPF thought leaders for information on patterns like MVVM. Until very recently, they had to do things differently due to limitations in the platform. Often times, that meant some small amount of wire-up code in the code-behind. I agree that in WPF it&#039;s harder to justify since the platform is more complete.

Pete</description>
		<content:encoded><![CDATA[<p>Thanks Reed. I appreciate the clarification. </p>
<p>I love this series, BTW.</p>
<p>On file dialog: One test I have mentally for what belongs in a viewmodel is &#8220;if I changed view technology, would it still apply&#8221;. I agree that a services is probably a better approach there.</p>
<p>Many Silverlight folks look to WPF thought leaders for information on patterns like MVVM. Until very recently, they had to do things differently due to limitations in the platform. Often times, that meant some small amount of wire-up code in the code-behind. I agree that in WPF it&#8217;s harder to justify since the platform is more complete.</p>
<p>Pete</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Reed</title>
		<link>http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-475</link>
		<dc:creator>Reed</dc:creator>
		<pubDate>Thu, 07 Jan 2010 16:46:37 +0000</pubDate>
		<guid isPermaLink="false">http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-475</guid>
		<description>Pete,

First off, I was suggesting that the goal should be to have zero code in the code behind - not necessarily that it is an absolute, hard rule.

That being said, I do agree that there are times when it&#039;s reasonable to have code in the code-behind.  However, in my experience to date, I&#039;ve yet to find a single instance where there wasn&#039;t a more elegant approach.  Typically, I&#039;ve found that, when I need code in the code behind file, it&#039;s nearly always handled more elegantly, and more reusably, by creating an attached property or (Expression Blend SDK-based) Behavior, or by using some form of dependency injection/service (I use MEF for this) to handle the creation from within the ViewModel.

Personally, I think displaying a FileDialog is a function of the ViewModel - not because of the dialog (which I agree is View, but could easily be provided via a service), but because the processing of a file dialog is logic that needs to be tested, and having that as part of a command or a method in the ViewModel makes testing much simpler.

Anyways, thank you very much for your comments!

-Reed</description>
		<content:encoded><![CDATA[<p>Pete,</p>
<p>First off, I was suggesting that the goal should be to have zero code in the code behind &#8211; not necessarily that it is an absolute, hard rule.</p>
<p>That being said, I do agree that there are times when it&#8217;s reasonable to have code in the code-behind.  However, in my experience to date, I&#8217;ve yet to find a single instance where there wasn&#8217;t a more elegant approach.  Typically, I&#8217;ve found that, when I need code in the code behind file, it&#8217;s nearly always handled more elegantly, and more reusably, by creating an attached property or (Expression Blend SDK-based) Behavior, or by using some form of dependency injection/service (I use MEF for this) to handle the creation from within the ViewModel.</p>
<p>Personally, I think displaying a FileDialog is a function of the ViewModel &#8211; not because of the dialog (which I agree is View, but could easily be provided via a service), but because the processing of a file dialog is logic that needs to be tested, and having that as part of a command or a method in the ViewModel makes testing much simpler.</p>
<p>Anyways, thank you very much for your comments!</p>
<p>-Reed</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pete</title>
		<link>http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-474</link>
		<dc:creator>Pete</dc:creator>
		<pubDate>Thu, 07 Jan 2010 06:58:51 +0000</pubDate>
		<guid isPermaLink="false">http://reedcopsey.com/2010/01/06/better-user-and-developer-experiences-from-windows-forms-to-wpf-with-mvvm-part-7-mvvm/#comment-474</guid>
		<description>When I first scanned this,what stood out to me was this bold quote:

&quot;The user interface should be declared entirely in XAML, with zero code behind.&quot;

While I agree that one should keep most logic out of the code-behind, I disagree that there should be zero code there.

View-specific code is ok to have there. That is, code that exists solely to perform a view function, such as building an animation or something, or setting up a relationship between two elements in a view when perhaps that is cumbersome to do in xaml, can be in the view. 

Putting something into a specific visual state in response to a message from the VM is, perhaps, another case. Typically (99%) you&#039;d handle that with binding, but that&#039;s not always a reasonable route to take.

Other view code could be for things like displaying a file dialog. Displaying a file dialog is really a view function. Dealing with the results of the dialog should happen elsewhere. If not displayed there, you&#039;re stuck doing something like displaying UI from the ViewModel, which is equally bad, if not worse, than having code in the view.

In practice, most apps will not need code in the code-behind, and most code folks are tempted to put there really shouldn&#039;t be there, but I&#039;d rather not be dogmatic about it :)

Pete</description>
		<content:encoded><![CDATA[<p>When I first scanned this,what stood out to me was this bold quote:</p>
<p>&#8220;The user interface should be declared entirely in XAML, with zero code behind.&#8221;</p>
<p>While I agree that one should keep most logic out of the code-behind, I disagree that there should be zero code there.</p>
<p>View-specific code is ok to have there. That is, code that exists solely to perform a view function, such as building an animation or something, or setting up a relationship between two elements in a view when perhaps that is cumbersome to do in xaml, can be in the view. </p>
<p>Putting something into a specific visual state in response to a message from the VM is, perhaps, another case. Typically (99%) you&#8217;d handle that with binding, but that&#8217;s not always a reasonable route to take.</p>
<p>Other view code could be for things like displaying a file dialog. Displaying a file dialog is really a view function. Dealing with the results of the dialog should happen elsewhere. If not displayed there, you&#8217;re stuck doing something like displaying UI from the ViewModel, which is equally bad, if not worse, than having code in the view.</p>
<p>In practice, most apps will not need code in the code-behind, and most code folks are tempted to put there really shouldn&#8217;t be there, but I&#8217;d rather not be dogmatic about it <img src='http://reedcopsey.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Pete</p>
]]></content:encoded>
	</item>
</channel>
</rss>
 
