Reputation: 16900
I am using Entity Framework 4.0 in my project. I have created a partial class with the exact same namespace as my Entities and added custom properties in it. How do i raise notification in the setter of these properties?
When i write PropertyChanged() i don't get any Intellisense help from VS2010 whatsoever and even the code doesn't compile. If I explicitly implement INotifyPropertyChanged interface in my partial class it doesn't let me raise the event in the setter of my property. I then inherit my partial class also explicitly from EntityObject:
public partial class Photo : EntityObject
{
private byte[] _photoByteArr = null;
[DataMemberAttribute()]
public byte[] PhotoByteArr
{
get
{
return _photoByteArr;
}
set
{
_photoByteArr = value;
//tried to put ReportPropertyChanged("PhotoByteArr"); here but it doesn't //work and gives error that its is not valid.
}
}
How do I raise property changed notifications in these custom properties?
Upvotes: 0
Views: 213
Reputation: 145
Are you creating your custom partial class in the same assembly?
From MSDN:
All partial-type definitions meant to be parts of the same type must be defined in the same assembly and the same module (.exe or .dll file). Partial definitions cannot span multiple modules.
http://msdn.microsoft.com/en-us/library/wa80x488%28v=vs.80%29.aspx
Upvotes: 1