0
I 중 하나를 수행 할 수 있습니다 뷰 모델 (부분 코드)의 데이터 요소가 있습니다모델 뷰 뷰 모델 모범 사례
public class PersonViewModel : INotifyPropertyChanged
{
public string FirstName
{
get
{
return firstName;
}
set
{
firstName = value;
OnPropertyChanged("FirstName");
}
}
public string LastName
{
get
{
return lastName;
}
set
{
lastName = value;
OnPropertyChanged("LastName");
}
}
}
또는 내가보기 모델 내부 DTO (부분 모드)로 포장 할 수 있습니다
public class PersonDTO : INotifyPropertyChanged
{
public string FirstName
{
get { return firstName;}
set
{
firstName = value;
OnPropertyChanged("FirstName");
}
}
public string LastName
{
get { return lastName; }
set
{
lastName = value;
OnPropertyChanged("LastName");
}
}
}
public class PersonViewModel
{
public PersonDTO boundToPerson;
}
접근 방법이 더 좋고 그 이유는 무엇입니까?