I am developing a ribbon WPF application using MVVM. The ribbon uses API Fluent Ribbon Control Suite; the MVVM framework uses Caliburn Micro, and DI uses Ninject.
What I observed is that when the application grows, the MainViewModel for view MainView keeps growing too. The 1st question: is it ever possible to separate the MainViewModel into multiple VMs? Or rather, multiple VMs control the same MainView that contains ribbons?
And the 2nd question is under this scenario:
The area under ribbon displays different Views when the user press buttons in the ribbon, that is, the "ActiveItem" is changed into other Views like GlobalDataView or BreakdownDataView etc.:
<Grid x:Name="SubView" Background="White">
<ContentControl x:Name="ActiveItem" />
</Grid>
Say now GlobalDataView is activated (assigned into the ContentControl), a contextual ribbon tab is shown upon the view's activation, and we assume that the contextual ribbon is with VM "ContextualRibbonGlobalDataViewModel" if there is a good solution for Question1. Also, the GlobalDataView itself also has its own VM called "GlobalDataViewModel". My question is: will it be possible to combine ContextualRibbonGlobalDataViewModel and GlobalDataViewModel? Since they both contain logic very specific to the GlobalDataView.
If Q1 is not possible, is there a way to let GlobalDataViewModel controls the contextual ribbon inside MainView?
My current approach is MainViewModel (MainView) + GlobalDataViewModel (GlobalDataView), such that the MainViewModel contains all the commands (actions in CM) for the GlobalData's view's contextual ribbon. MainViewModel has to use a mediator (the EventAggregator in CM) to talk to GlobalDataViewModel.
Thanks.