Note that there are some explanatory texts on larger screens.

plurals
  1. POMVVM Experts need your opinion on MVVM and Dataforms
    primarykey
    data
    text
    <p>as far as I understand the ViewModel should abstract the model from the view and add additional logic to handle the presentation stuff.</p> <p>My question is:</p> <p>How would I create a dataform that is suppose to handle user input for an order and details at once. It should present fields for entering the orders as well as the fields for 1 detail.</p> <p>My Model would have an object for an order which contains a list of OrderDetails.</p> <p>How would look my ViewModel for my OrderEntryForm like?</p> <p>Would I have an OrderViewModel and an OrderDetailViewModel and my my OrderEntryForm would contain a property of OrderViewModel and one for OrderDetailViewModel? (nesting ViewModels?) How would validation be handled in this case? Since Validation should go close to the model? Especially when I work with RIA-Service... Wouldn't it make more sense to put it in the ViewModel?</p> <p>How far would you abstract the Model from the ViewModel? Example:</p> <pre><code> private DateTime _OrderDate; public DateTime OrderDate { get { return _OrderDate; } set { if (_OrderDate != value) { _OrderDate = value; OnPropertyChanged("OrderDate"); } } } </code></pre> <p>this would mean I have to map the ViewModel-Property to Model-Properties. Cannot leverage Validation-Logic from the Model here...</p> <p>This example:</p> <pre><code> public DateTime OrderDate { get { return Model.OrderDate; } set { if (Model.OrderDate != value) { Model.OrderDate = value; OnPropertyChanged("OrderDate"); } } } </code></pre> <p>would requiere to pass in a Model. Have the access to the validation logic of the model but also a coupling... </p> <p>Most examples on the web show dataforms which use ViewModel's that a just a representation of the tables not a real abstraction... </p> <p>I know and I saw this </p> <p><a href="https://stackoverflow.com/questions/744474/combining-net-ria-services-and-mvvm-in-silverlight-3-0">stackoverflow.com/questions/744474/combining-net-ria-services-and-mvvm-in-silverlight-3-0 </a></p> <p>I also read nikhils blogpost on this but this handles also only Products straight mapping from the tables of the database... =(</p> <p>I know alot of questions...</p> <p>What are your opinions on that topic? How would you handle complex dataforms?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload