I am building a WPF application with the MVVM design pattern.
I am using DataTemplates to load user controls within a ContentControl:
<DataTemplate DataType="{x:Type menu:MenuViewModel}">
<menu:MenuView/>
</DataTemplate>
<ContentControl Content="{Binding Menu}" Visibility="{Binding MenuVisibility,
Converter={StaticResource BooleanToVisibility}}"/>
In addition to the menu I have a user control to manage the StatusBar and this is where the doubt arises. So that the other ViewModels can interact with the StatusBar, what I have done is create a MainViewModel in each ViewModel that needs this functionality and then assign it from the MainViewModel as follows:
_ChatViewModel.mainViewModel = this;
CurrentViewModel = _ChatViewModel;
This works, but I think there must be a "wheel" invented and I'm complicating. Is there any more "simple", "standard" mode that is being overlooked?