D
D
DarkByte20152016-04-25 08:06:41
WPF
DarkByte2015, 2016-04-25 08:06:41

Model or ViewModel?

Please tell me if the class is not used as a DataContext in any view, but in the ViewModel there is a collection of objects of this class that is attached to the view (for example, to the DataGrid), then this class is a Model or a ViewModel? Personally, it seems to me that all the same ViewModel, because all the same, its properties are involved in binding, but I'm not sure ... And what is important, this class also has other public properties and methods that are not bound, but simply used in the code.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vyacheslav Zolotov, 2016-04-25
@SZolotov

The data access layer is the model.

R
Roman, 2016-04-25
@yarosroman

Simply put, you have a VM, the VM has properties, these properties return some kind of data, data is a model.
VM is also a model, but its tasks are different, receiving, transferring data to the DataLayer, setting element properties, etc. VM is an intermediary between model and view.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question