I am still learning to use MVVM and Prism and have some general questions:
I have a grid in my view. Lets say I have a button that when I click I want it to auto size the grid columns. Where would that code go? Resizing grid columns is a view thing and the view model shouldn't know about it. So in this case would I be adding the button click handler in the view's code behind? I have the same question with grid editing and validation. The view model can see when a value is edited with two-way binding but if it decides that the value is invalid, how can it notify the grid to cancel the edit?
Lets say my view has a number of user controls and each user control needs to bind to data from a different object. Would my view model for this view just be a huge class with all of the data I would need for all of the different components of the view?
Regarding Prism and modular design, I am trying to figure out what a "module" is. My understanding is that a module is self contained, meaning if I pick up my module and drop it in another app, it should work. So if I have a class that makes some service calls (lets say SOAP calls to a server get some info) and populates a grid, my module would need to include both the MVVM components and my service layer, right? If I have multiple modules that use the same service layer, does each one need to include a copy of the service layer classes in order to be considered a complete module?
Thanks for any advice/info.