<?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: Using Behaviors to Allow the ViewModel to Manage View Lifetime in M-V-VM</title>
	<atom:link href="http://reedcopsey.com/2009/10/09/using-behaviors-to-allow-the-viewmodel-to-manage-view-lifetime-in-m-v-vm/feed/" rel="self" type="application/rss+xml" />
	<link>http://reedcopsey.com/2009/10/09/using-behaviors-to-allow-the-viewmodel-to-manage-view-lifetime-in-m-v-vm/</link>
	<description>Thoughts on C#, WPF, .NET, and programming for Scientific Visualization</description>
	<lastBuildDate>Wed, 01 Feb 2012 16:38:09 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Scott Marlowe</title>
		<link>http://reedcopsey.com/2009/10/09/using-behaviors-to-allow-the-viewmodel-to-manage-view-lifetime-in-m-v-vm/#comment-1674</link>
		<dc:creator>Scott Marlowe</dc:creator>
		<pubDate>Sun, 17 Apr 2011 17:09:52 +0000</pubDate>
		<guid isPermaLink="false">http://reedcopsey.com/?p=59#comment-1674</guid>
		<description>Beautiful! I&#039;ve been searching for a solution to this for a couple of hours now, trying different things, but your solution is what finally worked for me. Thanks.

I adapted this for use in a WPF app, by the way, to handle closing a Window type. The only thing I had to change was your WindowClassBehavior class declaration:

public class WindowCloseBehavior : Behavior</description>
		<content:encoded><![CDATA[<p>Beautiful! I&#8217;ve been searching for a solution to this for a couple of hours now, trying different things, but your solution is what finally worked for me. Thanks.</p>
<p>I adapted this for use in a WPF app, by the way, to handle closing a Window type. The only thing I had to change was your WindowClassBehavior class declaration:</p>
<p>public class WindowCloseBehavior : Behavior</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Reed</title>
		<link>http://reedcopsey.com/2009/10/09/using-behaviors-to-allow-the-viewmodel-to-manage-view-lifetime-in-m-v-vm/#comment-1668</link>
		<dc:creator>Reed</dc:creator>
		<pubDate>Mon, 21 Mar 2011 21:04:03 +0000</pubDate>
		<guid isPermaLink="false">http://reedcopsey.com/?p=59#comment-1668</guid>
		<description>Unfortunately, I do not have one available at this time.  A direct port would make little sense, as this is working against the Window class, which is unavailable in Silverlight.  However, the concepts could be ported to other uses very easily.</description>
		<content:encoded><![CDATA[<p>Unfortunately, I do not have one available at this time.  A direct port would make little sense, as this is working against the Window class, which is unavailable in Silverlight.  However, the concepts could be ported to other uses very easily.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hamza</title>
		<link>http://reedcopsey.com/2009/10/09/using-behaviors-to-allow-the-viewmodel-to-manage-view-lifetime-in-m-v-vm/#comment-1663</link>
		<dc:creator>Hamza</dc:creator>
		<pubDate>Thu, 10 Mar 2011 06:33:51 +0000</pubDate>
		<guid isPermaLink="false">http://reedcopsey.com/?p=59#comment-1663</guid>
		<description>Do you have a Silverlight 4 version of this behavior for MVVM?</description>
		<content:encoded><![CDATA[<p>Do you have a Silverlight 4 version of this behavior for MVVM?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Reed</title>
		<link>http://reedcopsey.com/2009/10/09/using-behaviors-to-allow-the-viewmodel-to-manage-view-lifetime-in-m-v-vm/#comment-1129</link>
		<dc:creator>Reed</dc:creator>
		<pubDate>Thu, 22 Jul 2010 22:48:17 +0000</pubDate>
		<guid isPermaLink="false">http://reedcopsey.com/?p=59#comment-1129</guid>
		<description>Dave,


The behavior, as is, just provides a single point where you can prevent the Window from being closed.  It does this by checking the CanExecute on the ICommand.

One simple option:

The command&#039;s CanExecute property, here, could prompt the user with a OK/Cancel button (and return false on Cancel).  This would warn the user, and they&#039;d have to hit &quot;OK&quot; to allow it to close without saving.</description>
		<content:encoded><![CDATA[<p>Dave,</p>
<p>The behavior, as is, just provides a single point where you can prevent the Window from being closed.  It does this by checking the CanExecute on the ICommand.</p>
<p>One simple option:</p>
<p>The command&#8217;s CanExecute property, here, could prompt the user with a OK/Cancel button (and return false on Cancel).  This would warn the user, and they&#8217;d have to hit &#8220;OK&#8221; to allow it to close without saving.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://reedcopsey.com/2009/10/09/using-behaviors-to-allow-the-viewmodel-to-manage-view-lifetime-in-m-v-vm/#comment-1128</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Thu, 22 Jul 2010 20:14:40 +0000</pubDate>
		<guid isPermaLink="false">http://reedcopsey.com/?p=59#comment-1128</guid>
		<description>How would you use this to warn a user they are going to lose their changes if they don&#039;t save?</description>
		<content:encoded><![CDATA[<p>How would you use this to warn a user they are going to lose their changes if they don&#8217;t save?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Attached Property port of my Window Close Behavior : Reed Copsey, Jr.</title>
		<link>http://reedcopsey.com/2009/10/09/using-behaviors-to-allow-the-viewmodel-to-manage-view-lifetime-in-m-v-vm/#comment-1075</link>
		<dc:creator>Attached Property port of my Window Close Behavior : Reed Copsey, Jr.</dc:creator>
		<pubDate>Thu, 15 Apr 2010 21:12:49 +0000</pubDate>
		<guid isPermaLink="false">http://reedcopsey.com/?p=59#comment-1075</guid>
		<description>[...] on The Code Project.&#160; It is a port of the MVVM-friendly Blend Behavior I wrote about in a previous article to use Attached Properties instead of a Blend [...]</description>
		<content:encoded><![CDATA[<p>[...] on The Code Project.&#160; It is a port of the MVVM-friendly Blend Behavior I wrote about in a previous article to use Attached Properties instead of a Blend [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Reed</title>
		<link>http://reedcopsey.com/2009/10/09/using-behaviors-to-allow-the-viewmodel-to-manage-view-lifetime-in-m-v-vm/#comment-1064</link>
		<dc:creator>Reed</dc:creator>
		<pubDate>Tue, 13 Apr 2010 22:05:53 +0000</pubDate>
		<guid isPermaLink="false">http://reedcopsey.com/?p=59#comment-1064</guid>
		<description>Tom,

The MessageBox here was just to demonstrate that this worked, in concept.  I completely agree that messaging should be abstracted.  Personally, I use Dependency Injection and a message service, but messaging models work as well.

Thanks for the feedback.

-Reed</description>
		<content:encoded><![CDATA[<p>Tom,</p>
<p>The MessageBox here was just to demonstrate that this worked, in concept.  I completely agree that messaging should be abstracted.  Personally, I use Dependency Injection and a message service, but messaging models work as well.</p>
<p>Thanks for the feedback.</p>
<p>-Reed</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom McKearney</title>
		<link>http://reedcopsey.com/2009/10/09/using-behaviors-to-allow-the-viewmodel-to-manage-view-lifetime-in-m-v-vm/#comment-1060</link>
		<dc:creator>Tom McKearney</dc:creator>
		<pubDate>Tue, 13 Apr 2010 14:24:02 +0000</pubDate>
		<guid isPermaLink="false">http://reedcopsey.com/?p=59#comment-1060</guid>
		<description>I would not put a MessageBox (UI code) inside a ViewModel.  You need an abstraction for that part too, or you&#039;re violating the idea behind MVVM</description>
		<content:encoded><![CDATA[<p>I would not put a MessageBox (UI code) inside a ViewModel.  You need an abstraction for that part too, or you&#8217;re violating the idea behind MVVM</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brent</title>
		<link>http://reedcopsey.com/2009/10/09/using-behaviors-to-allow-the-viewmodel-to-manage-view-lifetime-in-m-v-vm/#comment-1033</link>
		<dc:creator>Brent</dc:creator>
		<pubDate>Tue, 06 Apr 2010 02:18:54 +0000</pubDate>
		<guid isPermaLink="false">http://reedcopsey.com/?p=59#comment-1033</guid>
		<description>Awesome!  I&#039;ve been searching for an elegant way to do this for some time.  I really need to learn more about Behaviors.  Thanks for sharing this!</description>
		<content:encoded><![CDATA[<p>Awesome!  I&#8217;ve been searching for an elegant way to do this for some time.  I really need to learn more about Behaviors.  Thanks for sharing this!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
 
