开发者

Binding to Entity Object in WPF (C#)

I have a TextBox bound to the Entity Framework object User. Works fine. But now, when I change the User object to the new User.CreateUser(0, ...) or null, 开发者_StackOverflowTextBox doesn't change.

Why?

Best regards, James


pls post your binding and your datacontext, otherwise its hard to say whats wrong. i could just assume that INotifyPropertyChanged is not implemented.


You have to make sure that the binding hooks in at right level, not all changes are observed by the binding engine, e.g. if you only specify the Source that is identical to assigning the object referenced by the source, the binding will look for the PropertyChanged event on the source to update itself if you bind to a property using the Path, however it will never know if the source is swapped out.

If you bind to the User using the path this is not your issue, just what exactly is wrong is not inferable (for me, that is) from your question alone, you should probably post some code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜