<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : PropertyChanged event not firing in Distributed mode.</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : PropertyChanged event not firing in Distributed mode.</description>
  <pubDate>Tue, 21 Jul 2026 09:45:58 -700</pubDate>
  <lastBuildDate>Mon, 16 May 2011 11:43:57 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=2675</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>PropertyChanged event not firing in Distributed mode. :   Makes sense. Thanks!Bryan </title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2675&amp;PID=10700#10700</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=916" rel="nofollow">BringerOD</a><br /><strong>Subject:</strong> 2675<br /><strong>Posted:</strong> 16-May-2011 at 11:43am<br /><br />Makes sense.&nbsp; <div>&nbsp;</div><div>Thanks!</div><div>&nbsp;</div><div>Bryan</div>]]>
   </description>
   <pubDate>Mon, 16 May 2011 11:43:57 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2675&amp;PID=10700#10700</guid>
  </item> 
  <item>
   <title>PropertyChanged event not firing in Distributed mode. : Hi Bryan,  What&amp;#039;s happening...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2675&amp;PID=10698#10698</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=892" rel="nofollow">sbelini</a><br /><strong>Subject:</strong> 2675<br /><strong>Posted:</strong> 16-May-2011 at 11:35am<br /><br />Hi Bryan,<DIV>&nbsp;</DIV><DIV>What's happening in your code is that you are setting the event handler in the entity's constructor and serialization (i.e. n-tier)&nbsp;does not use the constructor. (in this case you'd only see the event fired on new enitities you created in the client)</DIV><DIV>&nbsp;</DIV><DIV>Also, bear in mind that even in 2-tier, if you load 1000 entities, you'd be setting 1000 event handlers. (one for each entity) That's not very efficient and I suggest you use EntityGroup.EntityPropertyChanged instead:</DIV><DIV>&nbsp;</DIV><DIV><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>var</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> eGroup = _entities.GetEntityGroup(</FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>typeof</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>(</FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>Customer</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>));</DIV><DIV><DIV>eGroup.EntityPropertyChanged += </FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>new</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> </FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>EventHandler</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&lt;</FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>EntityPropertyChangedEventArgs</DIV><DIV></FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>(eGroup_EntityPropertyChanged);</DIV><DIV></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas></FONT></FONT></FONT>&nbsp;</DIV><DIV><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>...</FONT></FONT></FONT></DIV><DIV><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas></FONT></FONT></FONT>&nbsp;</DIV><DIV><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>void</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> eGroup_EntityPropertyChanged(</FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>object</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> sender, </FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>EntityPropertyChangedEventArgs</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> e) {</FONT></FONT></DIV><DIV><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&nbsp; <FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>if</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> (e.Property.Name == </FONT></FONT><FONT color=#a31515 size=2 face=C&#111;nsolas><FONT color=#a31515 size=2 face=C&#111;nsolas><FONT color=#a31515 size=2 face=C&#111;nsolas>"CompanyName"</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>) {</DIV></DIV><DIV><DIV><DIV></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>&nbsp;&nbsp;&nbsp; var</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> Test = 1;</DIV><DIV></FONT></FONT><FONT color=#008000 size=2 face=C&#111;nsolas><FONT color=#008000 size=2 face=C&#111;nsolas><FONT color=#008000 size=2 face=C&#111;nsolas></FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&nbsp; }</DIV></FONT></FONT></DIV></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><DIV>}</DIV></FONT></FONT></DIV><DIV>&nbsp;</DIV><DIV>Silvio.</DIV>]]>
   </description>
   <pubDate>Mon, 16 May 2011 11:35:19 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2675&amp;PID=10698#10698</guid>
  </item> 
  <item>
   <title>PropertyChanged event not firing in Distributed mode. : uploads/916/PropertyChangeEventTest1.zip  I...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2675&amp;PID=10688#10688</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=916" rel="nofollow">BringerOD</a><br /><strong>Subject:</strong> 2675<br /><strong>Posted:</strong> 14-May-2011 at 11:37am<br /><br /><a href="uploads/916/PropertyChange&#069;ventTest1.zip" target="_blank">uploads/916/PropertyChangeEventTest1.zip</a><div><br></div><div>I uploaded a sample.</div><div><br></div><div>Set distributed to false. &nbsp;Put a breakpoint in the Customer class on the property changed event. Edit the company name field, leave the column to trigger the property event. &nbsp;The event will fire.</div><div><br></div><div>Set distributed to true and do the same thing. &nbsp;The event will NOT fire.</div><div><br></div><div><div>&nbsp; void Customer_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)</div><div>&nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (e.PropertyName == "CompanyName")</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var Test = 1;</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div>&nbsp; &nbsp; &nbsp; }</div></div><div><br></div><div><br></div><div>Bryan Reynolds</div>]]>
   </description>
   <pubDate>Sat, 14 May 2011 11:37:35 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2675&amp;PID=10688#10688</guid>
  </item> 
  <item>
   <title>PropertyChanged event not firing in Distributed mode. : Hi Bryan,   I could not reproduce...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2675&amp;PID=10685#10685</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=892" rel="nofollow">sbelini</a><br /><strong>Subject:</strong> 2675<br /><strong>Posted:</strong> 13-May-2011 at 4:05pm<br /><br />Hi Bryan, <DIV>&nbsp;</DIV><DIV>I could not reproduce your issue here.</DIV><DIV>&nbsp;</DIV><DIV>In my test case PropertyChanged fires in both 2 and n-tier.</DIV><DIV>&nbsp;</DIV><DIV>When you set isDistributed ="true" in the App.Config did you update the connectionString in the Web.Config file? (btw, you don't really need to comment out the connectionString in the App.Config file - setting isDistributed="true" will suffice)</DIV><DIV>&nbsp;</DIV><DIV>Can you provide a simple test case (against NorthwindIB)&nbsp;reproducing the issue?</DIV><DIV>&nbsp;</DIV><DIV>Silvio.</DIV><span style="font-size:10px"><br /><br />Edited by sbelini - 13-May-2011 at 4:07pm</span>]]>
   </description>
   <pubDate>Fri, 13 May 2011 16:05:02 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2675&amp;PID=10685#10685</guid>
  </item> 
  <item>
   <title>PropertyChanged event not firing in Distributed mode. : When I handled the PropertyChanged...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2675&amp;PID=10674#10674</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=916" rel="nofollow">BringerOD</a><br /><strong>Subject:</strong> 2675<br /><strong>Posted:</strong> 12-May-2011 at 10:29pm<br /><br /><p ="Ms&#111;normal">When I handled the PropertyChanged event on an entity itfires as expected when my application is connected to the database server inthe App.Config.<o:p></o:p></p><p ="Ms&#111;normal">When I switch it to use the webservice in distributed modeand comment out the connection to the database like below, the event no longerfires.<span style="mso-spacerun:yes">&nbsp;&nbsp; </span>Is this by design and if so howto I trap the property changed event.<o:p></o:p></p><p ="Ms&#111;normal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:  normal;mso-layout-grid-align:n&#111;ne;text-autospace:n&#111;ne"><span style="font-size:  9.5pt;font-family:C&#111;nsolas;color:blue"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>&lt;</span><span style="font-size:9.5pt;font-family:C&#111;nsolas;color:#A31515">objectServer</span><span style="font-size:9.5pt;font-family:C&#111;nsolas;color:blue"> </span><span style="font-size:9.5pt;font-family:C&#111;nsolas;color:red">remoteBaseURL</span><span style="font-size:9.5pt;font-family:C&#111;nsolas;color:blue"> = </span><span style="font-size:9.5pt;font-family:C&#111;nsolas">"<span style="color:blue">http://XXX.XXX.XXX</span>"<o:p></o:p></span></p><p ="Ms&#111;normal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:  normal;mso-layout-grid-align:n&#111;ne;text-autospace:n&#111;ne"><span style="font-size:  9.5pt;font-family:C&#111;nsolas;color:blue"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size:9.5pt;font-family:C&#111;nsolas;color:red">serverPort</span><span style="font-size:9.5pt;font-family:C&#111;nsolas;color:blue"> = </span><span style="font-size:9.5pt;font-family:C&#111;nsolas">"<span style="color:blue">80</span>"<o:p></o:p></span></p><p ="Ms&#111;normal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:  normal;mso-layout-grid-align:n&#111;ne;text-autospace:n&#111;ne"><span style="font-size:  9.5pt;font-family:C&#111;nsolas;color:blue"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size:9.5pt;font-family:C&#111;nsolas;color:red">serviceName</span><span style="font-size:9.5pt;font-family:C&#111;nsolas;color:blue"> = </span><span style="font-size:9.5pt;font-family:C&#111;nsolas">"<span style="color:blue">EntityService.svc</span>"<span style="color:blue"> &gt;</span><o:p></o:p></span></p><p ="Ms&#111;normal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:  normal;mso-layout-grid-align:n&#111;ne;text-autospace:n&#111;ne"><span style="font-size:  9.5pt;font-family:C&#111;nsolas;color:blue"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>&lt;</span><span style="font-size:9.5pt;font-family:C&#111;nsolas;color:#A31515">clientSettings</span><span style="font-size:9.5pt;font-family:C&#111;nsolas;color:blue"><span style="mso-spacerun:yes">&nbsp; </span></span><span style="font-size:9.5pt;  font-family:C&#111;nsolas;color:red">isDistributed</span><span style="font-size:  9.5pt;font-family:C&#111;nsolas;color:blue">=</span><span style="font-size:9.5pt;  font-family:C&#111;nsolas">"<span style="color:blue">true</span>"<span style="color:blue"> /&gt;</span><o:p></o:p></span></p><p ="Ms&#111;normal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:  normal;mso-layout-grid-align:n&#111;ne;text-autospace:n&#111;ne"><span style="font-size:  9.5pt;font-family:C&#111;nsolas;color:blue"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>&lt;/</span><span style="font-size:9.5pt;font-family:C&#111;nsolas;  color:#A31515">objectServer</span><span style="font-size:9.5pt;font-family:  C&#111;nsolas;color:blue">&gt;<o:p></o:p></span></p><p ="Ms&#111;normal"><o:p>&nbsp;</o:p></p>]]>
   </description>
   <pubDate>Thu, 12 May 2011 22:29:04 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2675&amp;PID=10674#10674</guid>
  </item> 
 </channel>
</rss>