Question

Is there a way to use PostSharp to change this kind of code:

private _property;
public Object Property
{
    get { return _property; }
    set
    {
        if (_property != value)
        {
            _property = value;
            PropertyChanged("Property");
        }
    }
}

into something like:

[NotifyChanged]
public Object Property { get; set; }

?

Was it helpful?

Solution

There are good instructions here:

http://www.postsharp.net/aspects/examples/inotifypropertychanged

This seems to match up with what you're looking for.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top