New Posts New Posts RSS Feed: PropertyChanged not firing for new entities?
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

PropertyChanged not firing for new entities?

 Post Reply Post Reply
Author
joshpainter View Drop Down
Newbie
Newbie
Avatar

Joined: 27-Aug-2007
Location: United States
Posts: 5
Post Options Post Options   Quote joshpainter Quote  Post ReplyReply Direct Link To This Post Topic: PropertyChanged not firing for new entities?
    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!
Back to Top
davidklitzke View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 14-Jun-2007
Posts: 715
Post Options Post Options   Quote davidklitzke Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
joshpainter View Drop Down
Newbie
Newbie
Avatar

Joined: 27-Aug-2007
Location: United States
Posts: 5
Post Options Post Options   Quote joshpainter Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down