只是一个快速的外观问题......在你声明它们的地方初始化完整属性的私有字段是否可以接受,或者普通开发人员会诅咒我的名字没有把它放在构造函数中?
private int _linesDataGridHeight = 300;
public int LinesDataGridHeight
{
get { return _linesDataGridHeight; }
set { SetProperty(ref _linesDataGridHeight, value); }
}
private bool _isHideLinesCheckboxChecked = false;
public bool IsHideLinesCheckboxChecked
{
get { return _isHideLinesCheckboxChecked; }
set
{
this.LinesDataGridHeight = value ? 0 : 300;
SetProperty(ref _isHideLinesCheckboxChecked, value);
}
}