【发布时间】:2018-03-02 17:18:17
【问题描述】:
我在我的 WPF 应用程序的视图模型中多次重复了下面的代码模式。有没有什么快速简单的方法来减少它,而不是求助于面向方面的编程之类的?
private string _scriptExecutionStage;
public string ScriptExecutionStage
{
get => _scriptExecutionStage;
set
{
if (value != _scriptExecutionStage)
{
_scriptExecutionStage = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("ScriptExecutionStage"));
}
}
}
【问题讨论】: