Hi
I'm fairly new to mvvm and I have several questions :
is model = business layer?
if i have a customer model that contains list of orders and list or orders each contains list of items, how would you separate this in a view? At the moment, my CustomerModel have a CustomerViewModel. CustomerViewModel contains list of OrderViewModel. OrderViewModel contains list of ItemsViewModel. So if I retrieve an existing customer from the data layer for example, I would then create the appropiate OrderViewModel and ItemViewModel based on the existing list. Is this how you usually implement mvvm? Honestly, the whole 'rewrapping object' doesnt really feels right.
My customerview contains list of orders and items, each represented by its own user control and repeated using ItemsControl. each item has its own add, edit and delete button. I want to have some sort of modal dialog that is disabling the current tab (not the whole app) while user presented with appropiate form. The easiest solution that I found was by sort of creating a content control that have a control dp (named Control) that you can set and automatically create the rectangle overlay when isVisible = true. Control then binded to CustomerViewModel's dialogControl property.... I dont see this as a proper mvvm solution as I seems to be muddling the viewmodel with view. I think the more proper way would be having a viewmodel in the customerviewmodel that represent what the dialog contains and provide a template for that in each viewmodel.... but i dont seems to be able to think a way to implement the rectangle overlay with this solution.
Thanks!