Currently I'm coding pretty much with WPF Applications in MVVM style.
I want to extend my current BaseViewModel with some new stuff that makes things easier and faster.
One functionality I want to add is to observe all properties (with a specific attribute) and call the PropertyChanged
event when the property is changed by default.
(This functionality is more about laziness, so it's not that important but I don't know how to accomplish this)
Currently I define a properties in the subclass like this:
private string _foo;
public string Foo
{
get { return _foo; }
set { _foo = value; OnPropertyChanged(); }
}
I plan to define (because it's faster and less code) the properties like this:
[Observe]
public string Foo { get; set; }
Is there any valid way to call the property changed event by default for every "marked" property in each sub class when the "set" method is called?