Strictly, DAL is not part of the MVVM pattern. DAL is the back model, and the view and view model should not know anything about DAL.
For example, expose objects as properties of your model, which are loaded upon first access.
public class ProductListModel
{
public List<Product> AllProducts
{
get
{
if (_AllProducts == null)
_AllProducts = MyServiceProxy.LoadAllProducts(...)
return _AllProducts;
}
}
public void SaveChanges()
{
if (_AllProducts != null)
MyServiceProxy.SaveProducts(AllProducts);
}
}
source
share