<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: How to create a generic method to get selected value from WPF ListBox Control</title>
	<atom:link href="http://ilearneditonline.wordpress.com/2008/04/05/how-to-create-a-generic-method-to-get-selected-value-from-wpf-listbox-control/feed/" rel="self" type="application/rss+xml" />
	<link>http://ilearneditonline.wordpress.com/2008/04/05/how-to-create-a-generic-method-to-get-selected-value-from-wpf-listbox-control/</link>
	<description></description>
	<lastBuildDate>Wed, 18 Feb 2009 19:09:56 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: insane4wpf</title>
		<link>http://ilearneditonline.wordpress.com/2008/04/05/how-to-create-a-generic-method-to-get-selected-value-from-wpf-listbox-control/#comment-88</link>
		<dc:creator>insane4wpf</dc:creator>
		<pubDate>Tue, 15 Apr 2008 23:55:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.ilearneditonline.com/?p=152#comment-88</guid>
		<description>Rob,

Thanks, I discovered that over the weekend and forgot to post it. With one small exception, which doesn&#039;t really make any difference. Thanks for the input, I wish I had found out about this before spending so much time traversing the visuals.

Contact contact = (Contact)MyListBox.SelectedItem;</description>
		<content:encoded><![CDATA[<p>Rob,</p>
<p>Thanks, I discovered that over the weekend and forgot to post it. With one small exception, which doesn&#8217;t really make any difference. Thanks for the input, I wish I had found out about this before spending so much time traversing the visuals.</p>
<p>Contact contact = (Contact)MyListBox.SelectedItem;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob Relyea</title>
		<link>http://ilearneditonline.wordpress.com/2008/04/05/how-to-create-a-generic-method-to-get-selected-value-from-wpf-listbox-control/#comment-87</link>
		<dc:creator>Rob Relyea</dc:creator>
		<pubDate>Tue, 15 Apr 2008 08:51:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.ilearneditonline.com/?p=152#comment-87</guid>
		<description>MyListBox.SelectedItem should return the Contact directly, so you shouldn&#039;t have to dig into the visuals of the DataTemplate.

Try something like this:
Contact contact = MyListBox.SelectedItem as Contact;
if (contact != null)
    MsgBox.Show(&quot;Contact.ID:&quot; + contact.ID);

Thanks, Rob
Rob Relyea &#124; WPF &amp; Xaml Language Team
robrelyea.com &#124; /blog &#124; /wpf &#124; /xaml</description>
		<content:encoded><![CDATA[<p>MyListBox.SelectedItem should return the Contact directly, so you shouldn&#8217;t have to dig into the visuals of the DataTemplate.</p>
<p>Try something like this:<br />
Contact contact = MyListBox.SelectedItem as Contact;<br />
if (contact != null)<br />
    MsgBox.Show(&#8220;Contact.ID:&#8221; + contact.ID);</p>
<p>Thanks, Rob<br />
Rob Relyea | WPF &amp; Xaml Language Team<br />
robrelyea.com | /blog | /wpf | /xaml</p>
]]></content:encoded>
	</item>
</channel>
</rss>
