<?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 : OnPropertyChanged never fires for Navigation properties</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2009 : OnPropertyChanged never fires for Navigation properties</description>
  <pubDate>Fri, 10 Apr 2026 21:38:04 -700</pubDate>
  <lastBuildDate>Wed, 09 Sep 2009 06:22:11 -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=1455</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>OnPropertyChanged never fires for Navigation properties : Greg,  I guess you&amp;#039;re right....</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1455&amp;PID=5341#5341</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=472" rel="nofollow">Sinnema</a><br /><strong>Subject:</strong> 1455<br /><strong>Posted:</strong> 09-Sep-2009 at 6:22am<br /><br />Greg,<DIV>&nbsp;</DIV><DIV>I guess you're right. We've solved this using an Intercepter in the Class itself like </DIV><DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp;public override void InitEntity(InitEntityCommand initEntityCommand)<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;base.InitEntity(initEntityCommand);</DIV><DIV>&nbsp;&nbsp;&nbsp;switch (initEntityCommand)<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;case InitEntityCommand.Load:<BR>&nbsp;&nbsp;&nbsp;&nbsp;case InitEntityCommand.Create:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;InitLastNameInterceptor();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;default:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;}</DIV><DIV>&nbsp;&nbsp;private bool m_LastNameInterceptorInitialized = false;</DIV><DIV>&nbsp;&nbsp;/// &lt;summary&gt;<BR>&nbsp;&nbsp;/// Initialize an interceptor for Name property of LastName to set the FullName property on Person<BR>&nbsp;&nbsp;/// &lt;/summary&gt;<BR>&nbsp;&nbsp;private void InitLastNameInterceptor()<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;// Prevent more than 1 initialization of the Interceptor<BR>&nbsp;&nbsp;&nbsp;if (!m_LastNameInterceptorInitialized)<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;PropertyInterceptorAction nameAction = new PropertyInterceptorAction&lt;DataEntityPropertySetInterceptorArgs&lt;DomainModel.LastName, String&gt;&gt;(<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;typeof(DomainModel.LastName),<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DomainModel.LastName.EntityPropertyNames.Name,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PropertyInterceptorMode.AfterSet,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NameSetter);<BR>&nbsp;&nbsp;&nbsp;&nbsp;PropertyInterceptorManager.CurrentInstance.AddAction(nameAction);</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;m_LastNameInterceptorInitialized = true;<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;}</DIV><DIV>&nbsp;&nbsp;/// &lt;summary&gt;<BR>&nbsp;&nbsp;/// Is called when the interceptor for Name in LastName is fired.<BR>&nbsp;&nbsp;/// &lt;/summary&gt;<BR>&nbsp;&nbsp;/// &lt;param name="args"&gt;&lt;/param&gt;<BR>&nbsp;&nbsp;private void NameSetter(DataEntityPropertySetInterceptorArgs&lt;DomainModel.LastName, String&gt; args)<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;SetFullName();<BR>&nbsp;&nbsp;}<BR></DIV>]]>
   </description>
   <pubDate>Wed, 09 Sep 2009 06:22:11 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1455&amp;PID=5341#5341</guid>
  </item> 
  <item>
   <title>OnPropertyChanged never fires for Navigation properties :  Paul, a couple of questions: Were...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1455&amp;PID=5336#5336</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=4" rel="nofollow">GregD</a><br /><strong>Subject:</strong> 1455<br /><strong>Posted:</strong> 08-Sep-2009 at 2:40pm<br /><br /><p>Paul, a couple of questions:</p><ol><li>Were you expecting PropertyChanged to fire on the parent when an internal&nbsp;change was made to one of the children, or when the list of children changed (by an addition or removal). It should not fire in the former case, but should in the latter. Did you find that it wasn't firing in the latter case?<br><br></li><li>I was able to get PropertyChanged to fire on an Order&nbsp;(parent) entity in response to an internal change made to one of the Order's OrderDetails(i.e., one of the parent's children). To do so, I implemented an AfterSet property interceptor as follows:</li></ol><blockquote style="margin-right: 0px;" dir="ltr"><p style="margin-right: 0px;" dir="ltr">&nbsp;&nbsp;&nbsp; &#091;AfterSet(EntityPropertyNames.UnitPrice)&#093;<br>&nbsp;&nbsp;&nbsp; public void UnitPriceChanged(PropertyInterceptorArgs&lt;Order, Decimal&gt; args) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PropertyChangedEventArgs eventArgs = new PropertyChangedEventArgs("OrderDetails");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.Order.EntityAspect.ForcePropertyChanged(eventArgs);<br>&nbsp;&nbsp;&nbsp; }<br><br>Is that what you are trying to do?<br><br>Note that, in instigating the raising of the PropertyChanged event on the parent, I indicated the parent's collection property (OrderDetails) as the property that changed, even though, strictly speaking, the list didn't change, only the internal details of one of its members.</p><p style="margin-right: 0px;" dir="ltr">Incidentally, I'm not obligated to indicate any particular property in my call to ForcePropertyChanged(). If I don't want to indicate a particular property, I can pass a null to the PropertyChangedEventArgs constructor.<br></p></blockquote><p style="margin-right: 0px;" dir="ltr">Greg<br></p><span style="font-size:10px"><br /><br />Edited by GregD - 08-Sep-2009 at 2:45pm</span>]]>
   </description>
   <pubDate>Tue, 08 Sep 2009 14:40:48 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1455&amp;PID=5336#5336</guid>
  </item> 
  <item>
   <title>OnPropertyChanged never fires for Navigation properties : Hi,  Today we tried to implement...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1455&amp;PID=5322#5322</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=472" rel="nofollow">Sinnema</a><br /><strong>Subject:</strong> 1455<br /><strong>Posted:</strong> 03-Sep-2009 at 6:36pm<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>Today we tried to implement a OnPropertyChanged for a Navigation property. The idea is as follows. We have a Person&nbsp;(one)&nbsp;entity which has a subset called LastName (many). I've discussed this in another thread (<a href="http://www.ideablade.com/forum/forum_posts.asp?TID=1345" target="_blank">http://www.ideablade.com/forum/forum_posts.asp?TID=1345</A>).</DIV><DIV>&nbsp;</DIV><DIV>We had an 'AfterSet' for this property which was never fired when changes were made in the RelatedEntityList LastName. So we thought, why don't we add a PropertyChanged to the LastName in the Person object, so we can track the changes made to that list. We've done extensive testing but found that the OnPropertyChanged never fired. Is it a bug?</DIV><DIV>&nbsp;</DIV><DIV>Regards,</DIV><DIV>Paul Sinnema</DIV><DIV>Diartis AG</DIV>]]>
   </description>
   <pubDate>Thu, 03 Sep 2009 18:36:00 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1455&amp;PID=5322#5322</guid>
  </item> 
 </channel>
</rss>