Click here to Skip to main content
15,923,273 members
Home / Discussions / WPF
   

WPF

 
QuestionMVVM type Question Pin
_Maxxx_18-Nov-10 19:52
professional_Maxxx_18-Nov-10 19:52 
AnswerRe: MVVM type Question Pin
Mycroft Holmes18-Nov-10 20:43
professionalMycroft Holmes18-Nov-10 20:43 
GeneralRe: MVVM type Question Pin
_Maxxx_18-Nov-10 22:48
professional_Maxxx_18-Nov-10 22:48 
GeneralRe: MVVM type Question Pin
Mycroft Holmes19-Nov-10 0:29
professionalMycroft Holmes19-Nov-10 0:29 
AnswerRe: MVVM type Question Pin
Pete O'Hanlon19-Nov-10 1:42
mvePete O'Hanlon19-Nov-10 1:42 
GeneralRe: MVVM type Question Pin
_Maxxx_19-Nov-10 3:53
professional_Maxxx_19-Nov-10 3:53 
GeneralRe: MVVM type Question Pin
Pete O'Hanlon19-Nov-10 4:04
mvePete O'Hanlon19-Nov-10 4:04 
GeneralRe: MVVM type Question Pin
_Maxxx_21-Nov-10 15:20
professional_Maxxx_21-Nov-10 15:20 
Essentially I'm just thinking that a VM, rather than having several properties which are bound to, has one ViewData property - which would 'contain' all of the properties that traditionally would be in the VM.

So if the ability of a command to execute depends on a member of the ViewData object - all well and good.
If the ability of a command to execute depends on some other criteria, then the VM would expose a property which the View could bind to for this purpose.

The former is a purely data-based rule, the latter some business logic rule - hence sensible separation, no?

it's like the application says
"Hey - I want to display this Customer data and let the user modify it, but the phone number can only be changed by an administrator"
The ViewModel goes and gets (or is given) a Customer Model.
The ViewModel creates a ViewData object exposing the model properties.
Additionally the ViewModel has a property IsAdministrator
The View uses IsAdministrator to determine whether the Phone Number is changeable - but this data isn't part of the ViewData


As for validation - frankly I haven't looked at validation in WPF/MVVM at all yet, so I'm not sure where the validation would go in the traditional model, let alone in this embryonic idea of a model!

If you have any good references for MVVM WPF validation I'd be interested in taking a look.

thanks for taking the time

max
___________________________________________
.\\axxx
(That's an 'M')

QuestionContext menu with check mark Pin
vikas amin18-Nov-10 4:59
vikas amin18-Nov-10 4:59 
AnswerRe: Context menu with check mark Pin
Abhinav S18-Nov-10 5:04
Abhinav S18-Nov-10 5:04 
GeneralRe: Context menu with check mark Pin
vikas amin17-Jan-11 5:04
vikas amin17-Jan-11 5:04 
QuestionActiveX Control in WPF Pin
martin500018-Nov-10 2:46
martin500018-Nov-10 2:46 
Questionrolling data in datagrid in silverlight Pin
CupLife17-Nov-10 23:52
CupLife17-Nov-10 23:52 
AnswerRe: rolling data in datagrid in silverlight Pin
Mycroft Holmes17-Nov-10 23:58
professionalMycroft Holmes17-Nov-10 23:58 
GeneralRe: rolling data in datagrid in silverlight Pin
CupLife18-Nov-10 0:15
CupLife18-Nov-10 0:15 
AnswerRe: rolling data in datagrid in silverlight Pin
Abhinav S18-Nov-10 0:56
Abhinav S18-Nov-10 0:56 
GeneralRe: rolling data in datagrid in silverlight Pin
CupLife18-Nov-10 1:27
CupLife18-Nov-10 1:27 
QuestionFile in DB or just Path Pin
mehrdadc4817-Nov-10 21:05
mehrdadc4817-Nov-10 21:05 
AnswerRe: File in DB or just Path Pin
Mycroft Holmes17-Nov-10 23:55
professionalMycroft Holmes17-Nov-10 23:55 
GeneralRe: File in DB or just Path Pin
Pete O'Hanlon18-Nov-10 0:14
mvePete O'Hanlon18-Nov-10 0:14 
GeneralRe: File in DB or just Path Pin
Mycroft Holmes18-Nov-10 0:24
professionalMycroft Holmes18-Nov-10 0:24 
GeneralRe: File in DB or just Path Pin
Pete O'Hanlon18-Nov-10 0:44
mvePete O'Hanlon18-Nov-10 0:44 
GeneralRe: File in DB or just Path Pin
#realJSOP18-Nov-10 1:52
professional#realJSOP18-Nov-10 1:52 
GeneralRe: File in DB or just Path Pin
Pete O'Hanlon18-Nov-10 2:03
mvePete O'Hanlon18-Nov-10 2:03 
GeneralRe: File in DB or just Path Pin
Mycroft Holmes18-Nov-10 13:11
professionalMycroft Holmes18-Nov-10 13:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.