silverlight 4.0 - MVVM / User Controls & View = ViewModel convention -
laurent of mvvm light fame introduced me mvvm, , convention of 1 view has 1 view model. rule of thumb user controls? 1 viewmodel each user control? when creating view leveraging more 1 user control, create viewmodel aggregate user control view models?
thanks in advance input.
richard
in mvvm projects have tended suggest: 1 viewmodel per usercontrol viewmodel aggregates these together.
that aggregating viewmodel viewmodel window rather usercontrol - though isn't necessary , may more result of preferences , history , fact work in wpf.
the 1 place don't have seperate viewmodel usercontrol create specific reusable usercontrols - things buttons specific visual effects, or custom sliders.
that reflected in project structure - have 2 standard folders usercontrols (which not have viewmodels) , views either windows or usercontrols, , have viewmodels.
Comments
Post a Comment