<?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: Clicking or DoubleClicking on an Item in a ListView</title>
	<atom:link href="http://www.designerwpf.com/2008/07/15/clicking-or-doubleclicking-on-an-item-in-a-listview/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.designerwpf.com/2008/07/15/clicking-or-doubleclicking-on-an-item-in-a-listview/</link>
	<description>Matthias Shapiro's WPF &#38; Silverlight Blog - Because Developers Get All The Good Blogs</description>
	<lastBuildDate>Fri, 05 Mar 2010 16:36:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Matthias Shapiro</title>
		<link>http://www.designerwpf.com/2008/07/15/clicking-or-doubleclicking-on-an-item-in-a-listview/comment-page-1/#comment-932</link>
		<dc:creator>Matthias Shapiro</dc:creator>
		<pubDate>Tue, 19 Aug 2008 18:13:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.designerwpf.com/2008/07/15/clicking-or-doubleclicking-on-an-item-in-a-listview/#comment-932</guid>
		<description>Yep... I double checked and EventSetters &lt;i&gt;definitely&lt;/i&gt; do not work for styles in a resource dictionary.</description>
		<content:encoded><![CDATA[<p>Yep&#8230; I double checked and EventSetters <i>definitely</i> do not work for styles in a resource dictionary.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vince</title>
		<link>http://www.designerwpf.com/2008/07/15/clicking-or-doubleclicking-on-an-item-in-a-listview/comment-page-1/#comment-880</link>
		<dc:creator>vince</dc:creator>
		<pubDate>Fri, 18 Jul 2008 02:13:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.designerwpf.com/2008/07/15/clicking-or-doubleclicking-on-an-item-in-a-listview/#comment-880</guid>
		<description>Actually, that&#039;s my (2nd) point as well - and why we use my sample code only on those lists that need to handle the DoubleClick. But by attaching it to the style of the ListItem, the handler gets the item clicked - and you don&#039;t have to search for it.</description>
		<content:encoded><![CDATA[<p>Actually, that&#8217;s my (2nd) point as well &#8211; and why we use my sample code only on those lists that need to handle the DoubleClick. But by attaching it to the style of the ListItem, the handler gets the item clicked &#8211; and you don&#8217;t have to search for it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matthias Shapiro</title>
		<link>http://www.designerwpf.com/2008/07/15/clicking-or-doubleclicking-on-an-item-in-a-listview/comment-page-1/#comment-878</link>
		<dc:creator>Matthias Shapiro</dc:creator>
		<pubDate>Thu, 17 Jul 2008 02:20:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.designerwpf.com/2008/07/15/clicking-or-doubleclicking-on-an-item-in-a-listview/#comment-878</guid>
		<description>Normally, I would agree. However, our case was one in which we had the item styles determining the visuals of all the ListViews in the application. That&#039;s well over 100 ListViews and not all of them needed to respond to DoubleClick events. 

This solution allows us to use standardized styles while being able to create the DoubleClick events on a case-by-case basis.</description>
		<content:encoded><![CDATA[<p>Normally, I would agree. However, our case was one in which we had the item styles determining the visuals of all the ListViews in the application. That&#8217;s well over 100 ListViews and not all of them needed to respond to DoubleClick events. </p>
<p>This solution allows us to use standardized styles while being able to create the DoubleClick events on a case-by-case basis.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vince</title>
		<link>http://www.designerwpf.com/2008/07/15/clicking-or-doubleclicking-on-an-item-in-a-listview/comment-page-1/#comment-877</link>
		<dc:creator>vince</dc:creator>
		<pubDate>Thu, 17 Jul 2008 02:00:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.designerwpf.com/2008/07/15/clicking-or-doubleclicking-on-an-item-in-a-listview/#comment-877</guid>
		<description>gotta agree using a style is so much easier.  we use them extensively and have a StyleManager class with static instances:

// handle the ListItem double click
Style style = new Style(typeof(ListViewItem), StyleManager.StyleListViewItem);
style.Setters.Add(new EventSetter(ListViewItem.MouseDoubleClickEvent,
	 new MouseButtonEventHandler(OnDoubleClickListViewItem)));
TableListView.ItemContainerStyle = style;</description>
		<content:encoded><![CDATA[<p>gotta agree using a style is so much easier.  we use them extensively and have a StyleManager class with static instances:</p>
<p>// handle the ListItem double click<br />
Style style = new Style(typeof(ListViewItem), StyleManager.StyleListViewItem);<br />
style.Setters.Add(new EventSetter(ListViewItem.MouseDoubleClickEvent,<br />
	 new MouseButtonEventHandler(OnDoubleClickListViewItem)));<br />
TableListView.ItemContainerStyle = style;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sbhl</title>
		<link>http://www.designerwpf.com/2008/07/15/clicking-or-doubleclicking-on-an-item-in-a-listview/comment-page-1/#comment-873</link>
		<dc:creator>sbhl</dc:creator>
		<pubDate>Wed, 16 Jul 2008 07:27:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.designerwpf.com/2008/07/15/clicking-or-doubleclicking-on-an-item-in-a-listview/#comment-873</guid>
		<description>Removed tags so that it hopefully does not disappear

Style TargetType=&quot;{x:Type ListViewItem}&quot;
    EventSetter Event=&quot;Control.MouseDoubleClick&quot; Handler=&quot;OnEdit&quot;
Style</description>
		<content:encoded><![CDATA[<p>Removed tags so that it hopefully does not disappear</p>
<p>Style TargetType=&#8221;{x:Type ListViewItem}&#8221;<br />
    EventSetter Event=&#8221;Control.MouseDoubleClick&#8221; Handler=&#8221;OnEdit&#8221;<br />
Style</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sbhl</title>
		<link>http://www.designerwpf.com/2008/07/15/clicking-or-doubleclicking-on-an-item-in-a-listview/comment-page-1/#comment-872</link>
		<dc:creator>sbhl</dc:creator>
		<pubDate>Wed, 16 Jul 2008 07:26:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.designerwpf.com/2008/07/15/clicking-or-doubleclicking-on-an-item-in-a-listview/#comment-872</guid>
		<description>Why not use a style and get directly from sender?

Place in resources, (should use a name on it if several listviews are used.


    


private void OnEdit(object sender, RoutedEventArgs e)
{
    // The sender is the listview item
}</description>
		<content:encoded><![CDATA[<p>Why not use a style and get directly from sender?</p>
<p>Place in resources, (should use a name on it if several listviews are used.</p>
<p>private void OnEdit(object sender, RoutedEventArgs e)<br />
{<br />
    // The sender is the listview item<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>
