Print Page | Close Window

PropertyChanged not firing for new entities?

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=385
Printed Date: 13-Mar-2025 at 4:21am


Topic: PropertyChanged not firing for new entities?
Posted By: joshpainter
Subject: PropertyChanged not firing for new entities?
Date Posted: 27-Aug-2007 at 2:13pm
If I create a new entity by calling the PersistenceManager.CreateEntity<T> method, and then bind that new entity to the UI without first calling entity.AddToManager(), it doesn't seem like the PropertyChanged events are firing to update the bound controls.  Is this by design or is it a bug?
 
Thanks!



Replies:
Posted By: davidklitzke
Date Posted: 27-Aug-2007 at 2:25pm
The entity.AddToManager method should typically get called within a few instructions of calling the CreateEntity method.  After an entity is created, it is in a detached state, and, strictly speaking, is  not a "real entity".  Therefore, please do not try to bind an entity when it is in a detached state.


Posted By: joshpainter
Date Posted: 27-Aug-2007 at 2:32pm
Thanks for the quick reply David!  It looks like the Undo() method is the "right" way to do what I want to accomplish anyway.



Print Page | Close Window