For developing Windows applications and decouple the UI from data access layer it is better to use MVVM pattern see explanation here
MVVM it allows to decouple the UI from Model, but in order to decouple the Data Access logic from Business logic you need to split your model and I recommend to use Domain Driven Design (DDD)you can read about it here
and use the ORM like Entity Framework
And you should follow the Persistence Ignorance Principle
For your example could be following:
in Domain Business logic layer you will have
//Domain Business layer logic
public class Person
{
public int Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public int Age { get; set; }
}
interface IPersonRepository
{
IEnumerable<Person> GetAll();
void Update(Person person);
}
in Application layer
//Application logic
class PersonViewModel
{
private readonly IPersonRepository _personRepository;
public PersonViewModel(IPersonRepository personRepository)
{
_personRepository = personRepository;
}
public ObservableCollection<Person> Persons
{
get { return new ObservableCollection<Person>(_personRepository.GetAll()); }
}
}
and in the Data Access you will have the implementation of IPersonRepository
//Data Access layer Persistance logic
class PersonRepository : IPersonRepository
{
public IEnumerable<Person> GetAll()
{
// ORM Implementation here
return new List<Person>();
}
public void Update(Person person)
{
// Update logic here
}
}
Application Layer and Data Access layer should depend on Domain layer and Data Access logic doesn't know nothing about the Application layer