I want to get rid of the space consuming and repetitive RaisePropertyChanged-Properties on my model classes. I want my model class...
public class ProductWorkItem : NotificationObject
{
private string name;
public string Name
{
get { return name; }
set {
if (value == name) return;
name = value; RaisePropertyChanged(() => Name);
}
}
private string description;
public string Description
{
get { return description; }
set {
if (value == description) return;
description = value; RaisePropertyChanged(() => Description);
}
}
private string brand;
public string Brand
{
get { return brand; }
set {
if (value == brand) return;
brand = value; RaisePropertyChanged(() => Brand);
}
}
}
...to look as simple as this again: (but notify the view when a property changes)
public class ProductWorkItem
{
public string Name{ get; set; }
public string Description{ get; set; }
public string Brand{ get; set; }
}
Could this be achieved with some sort of proxy class?
I want to avoid writing a proxy for every single model class.
NotificationObject
is part of thePrism 4.0
framework – Infatuated