<?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: How to close a View from a ViewModel ?</title>
	<atom:link href="http://www.japf.fr/2009/09/how-to-close-a-view-from-a-viewmodel/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.japf.fr/2009/09/how-to-close-a-view-from-a-viewmodel/</link>
	<description>Jeremy Alles Presentation Foundation: WPF, .Net and modern software development</description>
	<lastBuildDate>Sat, 24 Jul 2010 08:59:47 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Jeremy</title>
		<link>http://www.japf.fr/2009/09/how-to-close-a-view-from-a-viewmodel/comment-page-1/#comment-1168</link>
		<dc:creator>Jeremy</dc:creator>
		<pubDate>Mon, 01 Mar 2010 22:10:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.japf.fr/?p=252#comment-1168</guid>
		<description>Rob, 

As I said at the end of the post, this is a very basic implementation. If you need more sophisticated features you would have a dedicated service to manage lifetime of Window. You can take a look at the Calcium framework.</description>
		<content:encoded><![CDATA[<p>Rob, </p>
<p>As I said at the end of the post, this is a very basic implementation. If you need more sophisticated features you would have a dedicated service to manage lifetime of Window. You can take a look at the Calcium framework.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob</title>
		<link>http://www.japf.fr/2009/09/how-to-close-a-view-from-a-viewmodel/comment-page-1/#comment-1053</link>
		<dc:creator>Rob</dc:creator>
		<pubDate>Tue, 02 Feb 2010 22:43:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.japf.fr/?p=252#comment-1053</guid>
		<description>This doesnt really help though when the VM is behind a user control somewhere down the visual tree, which is more likely. How would you get the event fired from this VM to bubble up to the window that contains the usercontrol which has this Vm as its datacontext?</description>
		<content:encoded><![CDATA[<p>This doesnt really help though when the VM is behind a user control somewhere down the visual tree, which is more likely. How would you get the event fired from this VM to bubble up to the window that contains the usercontrol which has this Vm as its datacontext?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy</title>
		<link>http://www.japf.fr/2009/09/how-to-close-a-view-from-a-viewmodel/comment-page-1/#comment-1031</link>
		<dc:creator>Jeremy</dc:creator>
		<pubDate>Wed, 27 Jan 2010 11:59:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.japf.fr/?p=252#comment-1031</guid>
		<description>I think you could use a Behavior that execute a command whenever a Window is closing. In the command target you could use some kind of &quot;DialogService&quot; to find a service which would open the dialogbox for you :-)</description>
		<content:encoded><![CDATA[<p>I think you could use a Behavior that execute a command whenever a Window is closing. In the command target you could use some kind of &#8220;DialogService&#8221; to find a service which would open the dialogbox for you <img src='http://www.japf.fr/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Skinner</title>
		<link>http://www.japf.fr/2009/09/how-to-close-a-view-from-a-viewmodel/comment-page-1/#comment-1029</link>
		<dc:creator>Daniel Skinner</dc:creator>
		<pubDate>Wed, 27 Jan 2010 10:58:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.japf.fr/?p=252#comment-1029</guid>
		<description>Regarding closing the window with the X: What if we need to show a save changes dialog for example?</description>
		<content:encoded><![CDATA[<p>Regarding closing the window with the X: What if we need to show a save changes dialog for example?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JAPF &#187; Blog Archive &#187; Review of 2009 blog posts</title>
		<link>http://www.japf.fr/2009/09/how-to-close-a-view-from-a-viewmodel/comment-page-1/#comment-969</link>
		<dc:creator>JAPF &#187; Blog Archive &#187; Review of 2009 blog posts</dc:creator>
		<pubDate>Wed, 06 Jan 2010 19:02:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.japf.fr/?p=252#comment-969</guid>
		<description>[...] How to close a View from a ViewModel ? [...]</description>
		<content:encoded><![CDATA[<p>[...] How to close a View from a ViewModel ? [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy</title>
		<link>http://www.japf.fr/2009/09/how-to-close-a-view-from-a-viewmodel/comment-page-1/#comment-491</link>
		<dc:creator>Jeremy</dc:creator>
		<pubDate>Tue, 20 Oct 2009 08:09:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.japf.fr/?p=252#comment-491</guid>
		<description>Well in this case the closing procedure is handled by WPF itself right ? What do you want to do in particular ?</description>
		<content:encoded><![CDATA[<p>Well in this case the closing procedure is handled by WPF itself right ? What do you want to do in particular ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: arconaut</title>
		<link>http://www.japf.fr/2009/09/how-to-close-a-view-from-a-viewmodel/comment-page-1/#comment-486</link>
		<dc:creator>arconaut</dc:creator>
		<pubDate>Mon, 19 Oct 2009 16:19:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.japf.fr/?p=252#comment-486</guid>
		<description>Thanks for this useful post!
But how would you handle closing of a window when user clicks the default window&#039;s Close button? (&quot;Red X&quot;)</description>
		<content:encoded><![CDATA[<p>Thanks for this useful post!<br />
But how would you handle closing of a window when user clicks the default window&#8217;s Close button? (&#8220;Red X&#8221;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bob Bartholomay</title>
		<link>http://www.japf.fr/2009/09/how-to-close-a-view-from-a-viewmodel/comment-page-1/#comment-428</link>
		<dc:creator>Bob Bartholomay</dc:creator>
		<pubDate>Tue, 29 Sep 2009 20:29:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.japf.fr/?p=252#comment-428</guid>
		<description>I blogged about a similar (same?) forum post a few days ago and my research revealed few alternatives that may be of interest see: http://blog.flexforcefive.com/?p=206</description>
		<content:encoded><![CDATA[<p>I blogged about a similar (same?) forum post a few days ago and my research revealed few alternatives that may be of interest see: <a href="http://blog.flexforcefive.com/?p=206" rel="nofollow">http://blog.flexforcefive.com/?p=206</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy</title>
		<link>http://www.japf.fr/2009/09/how-to-close-a-view-from-a-viewmodel/comment-page-1/#comment-426</link>
		<dc:creator>Jeremy</dc:creator>
		<pubDate>Tue, 29 Sep 2009 17:48:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.japf.fr/?p=252#comment-426</guid>
		<description>Thomas,

Yes, as always an attached property can always comes to the rescue to clean up our code :-)

Mike,

Ok now it makes sense. Thanks for your details !</description>
		<content:encoded><![CDATA[<p>Thomas,</p>
<p>Yes, as always an attached property can always comes to the rescue to clean up our code <img src='http://www.japf.fr/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Mike,</p>
<p>Ok now it makes sense. Thanks for your details !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Strobel</title>
		<link>http://www.japf.fr/2009/09/how-to-close-a-view-from-a-viewmodel/comment-page-1/#comment-425</link>
		<dc:creator>Mike Strobel</dc:creator>
		<pubDate>Tue, 29 Sep 2009 17:27:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.japf.fr/?p=252#comment-425</guid>
		<description>Well, I use a somewhat different pattern that I call PMVP (Presentation Model-View-Presenter), so my suggestion may not be appropriate for MVVM.  You can think of PMVP as MVVM with the ViewModel broken up into two separate entities: a Presentation Model encapsulating the data model, UI state information, change notification, and commands; and a Presenter, containing the UI logic (a sort of controller for the view).

My Presenter classes generally have Run() and Terminate() methods, which (among other things) call OnCreated and OnDestroyed methods on the View.  In this pattern, the CloseCommand in the PM would be handled by the Presenter, which would either terminate itself or raise a termination request event to some higher-level entity like an application controller, task director, etc.</description>
		<content:encoded><![CDATA[<p>Well, I use a somewhat different pattern that I call PMVP (Presentation Model-View-Presenter), so my suggestion may not be appropriate for MVVM.  You can think of PMVP as MVVM with the ViewModel broken up into two separate entities: a Presentation Model encapsulating the data model, UI state information, change notification, and commands; and a Presenter, containing the UI logic (a sort of controller for the view).</p>
<p>My Presenter classes generally have Run() and Terminate() methods, which (among other things) call OnCreated and OnDestroyed methods on the View.  In this pattern, the CloseCommand in the PM would be handled by the Presenter, which would either terminate itself or raise a termination request event to some higher-level entity like an application controller, task director, etc.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
