Click here to Skip to main content
15,909,440 members
Home / Discussions / WPF
   

WPF

 
QuestionRe: MVVM question: hierarchical model representation Pin
Member 103390714-Oct-11 3:53
Member 103390714-Oct-11 3:53 
AnswerRe: MVVM question: hierarchical model representation Pin
SledgeHammer0114-Oct-11 5:01
SledgeHammer0114-Oct-11 5:01 
GeneralRe: MVVM question: hierarchical model representation Pin
SledgeHammer0114-Oct-11 5:47
SledgeHammer0114-Oct-11 5:47 
GeneralRe: MVVM question: hierarchical model representation Pin
SledgeHammer0114-Oct-11 6:30
SledgeHammer0114-Oct-11 6:30 
GeneralRe: MVVM question: hierarchical model representation Pin
SledgeHammer0114-Oct-11 8:07
SledgeHammer0114-Oct-11 8:07 
GeneralRe: MVVM question: hierarchical model representation Pin
SledgeHammer0114-Oct-11 8:22
SledgeHammer0114-Oct-11 8:22 
GeneralRe: MVVM question: hierarchical model representation Pin
Member 103390714-Oct-11 8:00
Member 103390714-Oct-11 8:00 
GeneralRe: MVVM question: hierarchical model representation Pin
SledgeHammer0114-Oct-11 8:19
SledgeHammer0114-Oct-11 8:19 
I never said you shouldn't use MVVM. On the contrary, I think its great even for small apps once you have a good MVVM framework established. I just said you shouldn't separate the data layer from the model. I'll even toss Colin a bone here and add "unless there is a very good reason to do so". It doesn't seem that you are using any 3rd party components and it seems like you are owning all the code, so there is no reason to do so.

I also never said anything about combining the model and viewmodel. Those should definitely be separate.

The model should implement INPC (or derive from a base class that does) and should handle dealing with the data. I.e. writing to the database, or XML, etc.

The viewmodel should well, I hate to use the word "repackage" because that might give you the impression that you are supposed to repackage the data, which you aren't. Its just a "gateway" from the model to the view. It just presents the data in a way the view can use it. Often times, this is just exposing a collection as a property to get the data to the view. It really doesn't have to be all that complicated. With a few exceptions, most of the VMs I've seen in my life are very simple which is one of the joys of MVVM IMO. If the VM is doing a ton of work in manipulating the data, something is wrong somewhere. The VM also exposes commands that the View can use to manipulate the model, but its just a hook up. The real work of manipulating the models internals belong in the model.
GeneralRe: MVVM question: hierarchical model representation Pin
Member 103390714-Oct-11 9:13
Member 103390714-Oct-11 9:13 
QuestionSetting combobox width by binding Pin
Preston Phillips13-Oct-11 10:30
Preston Phillips13-Oct-11 10:30 
GeneralRe: Setting combobox width by binding Pin
Preston Phillips13-Oct-11 10:51
Preston Phillips13-Oct-11 10:51 
GeneralRe: Setting combobox width by binding Pin
Preston Phillips14-Oct-11 8:37
Preston Phillips14-Oct-11 8:37 
QuestionSet DisplayMemberPath For Dynamic Combobox Pin
Matt Tapia11-Oct-11 8:20
Matt Tapia11-Oct-11 8:20 
AnswerRe: Set DisplayMemberPath For Dynamic Combobox Pin
Wayne Gaylard12-Oct-11 1:09
professionalWayne Gaylard12-Oct-11 1:09 
GeneralRe: Set DisplayMemberPath For Dynamic Combobox Pin
Matt Tapia12-Oct-11 4:19
Matt Tapia12-Oct-11 4:19 
GeneralRe: Set DisplayMemberPath For Dynamic Combobox Pin
Alisaunder13-Oct-11 2:46
Alisaunder13-Oct-11 2:46 
GeneralRe: Set DisplayMemberPath For Dynamic Combobox Pin
Wayne Gaylard13-Oct-11 2:59
professionalWayne Gaylard13-Oct-11 2:59 
QuestionWPF Datagrid checkbox property not updated Pin
Preston Phillips11-Oct-11 8:17
Preston Phillips11-Oct-11 8:17 
AnswerRe: WPF Datagrid checkbox property not updated Pin
Wayne Gaylard12-Oct-11 1:11
professionalWayne Gaylard12-Oct-11 1:11 
GeneralRe: WPF Datagrid checkbox property not updated Pin
Preston Phillips12-Oct-11 3:52
Preston Phillips12-Oct-11 3:52 
GeneralRe: WPF Datagrid checkbox property not updated Pin
Preston Phillips12-Oct-11 4:38
Preston Phillips12-Oct-11 4:38 
GeneralRe: WPF Datagrid checkbox property not updated Pin
Preston Phillips12-Oct-11 5:15
Preston Phillips12-Oct-11 5:15 
QuestionValue Conversions Pin
Geysser8-Oct-11 9:04
Geysser8-Oct-11 9:04 
AnswerRe: Value Conversions Pin
Abhinav S9-Oct-11 0:45
Abhinav S9-Oct-11 0:45 
AnswerRe: Value Conversions Pin
SledgeHammer019-Oct-11 8:05
SledgeHammer019-Oct-11 8:05 

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.