Search code examples
wpfmodel-view-controllerviewmodel

Should a user control have its own view model?


I have a window made up of several user controls and was wondering whether each user control have its own view model or should the window as a whole have only one view model?


Solution

  • This is not a yes or no question. It depends on whether having extra view models affords you better maintainability or testability. There's no point adding view models if it doesn't gain you anything. You'll need to gauge whether the overhead is worth it to your particular use case.