At the moment I have the following structure of my application:
- A folder named ViewModels
- A folder called Views
- A folder called Services
The ViewModel has a class, called ItemTypeDetailViewModel. How it looks:
public class ItemTypeDetailViewModel
{
private IItemTypenService itemTypeService;
public ObservableCollection<Models.ItemType> ItemTypes { get; set; }
public ICollectionView CollectionView { get; set; }
public ItemTypeDetailViewModel()
{
itemTypeService = new ItemTypeService();
itemTypeService.GetItemTypes();
CollectionView = CollectionViewSource.GetDefaultView(ItemTypes);
}
}
In the class I have a reference to the Service Layer (for now no DI, just newing in the constructor). With the help of the itemTypeService I will get a collection of ItemTypes. This is maybe a more MVP kind of structuring?
But now I start to get confused because most of the examples I see of MVVM have the model wrapped in a ViewModel.
What is a good approach here?