views:

245

answers:

2

Hi I am trying to raise the PropertyChanged event of an EntityObject, I don't find a way to do it, is this possible?

+2  A: 
OnPropertyChanged("PropertyName")
Shimmy
A: 

You should be able to decorate the property with an attribute and then call the ReportPropertyChanging and ReportPropertyChanged method like so:

[EdmScalarPropertyAttribute(IsNullable = false)]
public byte Status
{
    get 
    {
        return _status;
    }
    set
    {
        if (_status != value)
        {
            ReportPropertyChanging("Status");
            _status = value;
            ReportPropertyChanged("Status");
        }
    }
}
jellomonkey
Wrong. 1) I wanted to workaround this ReportPropertyChanged, I wanted to raise the base class' event, the ReportPropertyChanged maybe eventually raises that event but it does more previous functionality too, when I said "manually raise" this is what I didn't want, I've just found the answer - very simple, take a look below.2) The code shown above is generated by a tool and I am not gonna mess around with it.3) I tagged my post with vb.net. Thank you for your response anyway.
Shimmy
1)Perhaps if you wanted to work around the ReportPropertyChanged functionality you could have mentioned it in the question. 2)The code didn't come from a tool. 3)This code is trivially easy to express in VB.net. 4) People like you are the reason I am going to stop participating in this community.
jellomonkey