モデルクラスのスペースを消費し、反復するRaisePropertyChanged-Propertiesを削除したいと思います。モデルクラスが欲しい...
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);
}
}
}
...これと同じくらい単純に見えるように:(ただし、プロパティが変更されたときにビューに通知します)
public class ProductWorkItem
{
public string Name{ get; set; }
public string Description{ get; set; }
public string Brand{ get; set; }
}
これは、ある種のプロキシクラスで実現できますか?
モデルクラスごとにプロキシを作成することは避けたいと思います。