小编Ale*_*dro的帖子

避免在每个setter中调用RaisePropertyChanged

我想摆脱模型类中占用空间和重复性的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; …
Run Code Online (Sandbox Code Playgroud)

c# proxy-classes mvvm inotifypropertychanged

3
推荐指数
2
解决办法
3821
查看次数

标签 统计

c# ×1

inotifypropertychanged ×1

mvvm ×1

proxy-classes ×1