I have a MVVM desktop application. In my View, I have a TabControl.
Any suggestions on the best practice to switch to a specific tab by changing a property on the ViewModel?
I suppose it could be done with a SelectedTab property, but then the Tabs have to exist in the ViewModel, and the View must bind to the Tabs list in ViewModel. At the moment, the two tabs are static, in the sence that I won’t be creating/deleting any dynamically during execution. So I create the tabs in the View, and they represent two different sets of control bound to the same ViewModel, so it’s not a case of different tabs for different view model instances.
Try binding to the SelectedIndex property to switch to a Tab.