views:

37

answers:

1

Hi,

I have a class coming from EntityFramework which I have extended with a few properties in a partial class. I expose and edit the values of these properties in my interface and everything works fine. But, I want to detect the change of value in the properties in my ViewModel, and while investigating the EntityState, HasChanges, HasPropertyChanges Properties on my collection they are all unmodified or false?! Even though I can see that the value of my properties has changed...

So, do I have to do anything special on my partial class for it to update the HasChanges, HasPropertychanges flag or the EntityState? Is dependency properties a more correct way to do this?

Using: MVVM, SL4, EF, WCF RIA Services.

+1  A: 

The EF, by default, does no change tracking on properties which are not part of the EF model. Self-tracking entities can change this, but they probably should not. You should not try and re-purpose the EF's change tracking mechanism for non-EF uses. It's likely to break more than it fixes.

Craig Stuntz
Craig, thanx for that peice of info :)But, how can i solve my problem then? I need to be able to monitor propertychanges in a prop in a partial class...
Mcad001
You could track it yourself, could you not? Set a private "modified" flag in the setter.
Craig Stuntz