So I currently have a Window
with a TabControl
. The MainWindow
has its own ViewModel and all the TabItems
have their own ViewModels also.
I can easily change tabs from the MainWindow
ViewModel through a bound SelectedIndex
property. What I would like to do is change to another tab from code that runs within ANOTHER tab viewmodel. Since the Tabs are not part of the MainWindowViewModel, I am looking for a clean way to change the Tab without resorting to code behind to do it.
There are also cases, where I might need to change the tab from something such as a message prompt. I thinking my only way is to create and event and subscribe to that from MainWindowViewModel
.