mmmm
mmmm

Reputation: 2471

Ideas to address MVVM project and ever increasing size of MainViewModel / Model?

I am starting on expanding a simple MVVM C# application. The Model and the basic ModelView are starting to grow to unmanageable sized - I have split out the data access of the Model to reduce complexity, and even this is getting uncomfortably big.

Does anyone have any suggestions on what to refactor before it all collapses under it own weight? I am open to everything from componentizing to throwing it all away.

Thanks in advance

Upvotes: 1

Views: 118

Answers (1)

Derek Beattie
Derek Beattie

Reputation: 9478

A View to ViewModel doesn't have to be 1 to 1. Break the Views and ViewModels in to smaller manageable pieces. Your main View and ViewModel can be an aggregation of smaller Views and ViewModels. Say you had a view, CustomerView, that had a ListBox and a couple grids. CustomerView is associated with CustomerViewModel. The ListBox and grids could be put in their own Views and ViewModels. So you might have and it's associated CustomerListViewModel and the same could apply to the grids.

Upvotes: 1

Related Questions