<?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: WPF: How to set the SelectedValue on Data Bound ComboBox</title>
	<atom:link href="http://ilearneditonline.wordpress.com/2008/06/26/how-to-set-the-selectedvalue-on-data-bound-wpf-combobox/feed/" rel="self" type="application/rss+xml" />
	<link>http://ilearneditonline.wordpress.com/2008/06/26/how-to-set-the-selectedvalue-on-data-bound-wpf-combobox/</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: ed</title>
		<link>http://ilearneditonline.wordpress.com/2008/06/26/how-to-set-the-selectedvalue-on-data-bound-wpf-combobox/#comment-117</link>
		<dc:creator>ed</dc:creator>
		<pubDate>Sun, 19 Oct 2008 01:35:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.ilearneditonline.com/?p=178#comment-117</guid>
		<description>good topic!

Actually, you dont need to inherit INotifyPropertyChanged for both classes Contact and Company since ObservableCollection already provides notifications.

From msdn
http://msdn.microsoft.com/en-us/library/ms668604.aspx

ObservableCollection(T) Class definition:
&quot;Represents a dynamic data collection that provides notifications when items get added, removed, or when the whole list is refreshed.&quot;

I took the example, got rid of the notifying setters and it works find!

Contact would be:
public class Contact
{
   public int Id { get; set; }

   public int CompanyId { get; set; }

   public string FirstName { get; set; }

   public string LastName { get; set; }

    
   public Contact(int id, 
                  int companyId, 
                  string firstName, 
                  string lastName)
   {
      this.Id = id;
      this.CompanyId = companyId;
      this.FirstName = firstName;
      this.LastName = lastName;
   }
}</description>
		<content:encoded><![CDATA[<p>good topic!</p>
<p>Actually, you dont need to inherit INotifyPropertyChanged for both classes Contact and Company since ObservableCollection already provides notifications.</p>
<p>From msdn<br />
<a href="http://msdn.microsoft.com/en-us/library/ms668604.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms668604.aspx</a></p>
<p>ObservableCollection(T) Class definition:<br />
&#8220;Represents a dynamic data collection that provides notifications when items get added, removed, or when the whole list is refreshed.&#8221;</p>
<p>I took the example, got rid of the notifying setters and it works find!</p>
<p>Contact would be:<br />
public class Contact<br />
{<br />
   public int Id { get; set; }</p>
<p>   public int CompanyId { get; set; }</p>
<p>   public string FirstName { get; set; }</p>
<p>   public string LastName { get; set; }</p>
<p>   public Contact(int id,<br />
                  int companyId,<br />
                  string firstName,<br />
                  string lastName)<br />
   {<br />
      this.Id = id;<br />
      this.CompanyId = companyId;<br />
      this.FirstName = firstName;<br />
      this.LastName = lastName;<br />
   }<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>
