I have a main window with a tab control containing 2 tabItems:

I currently
No sure why the selected answer is suggesting to use ObservableCollection and create a collection of tabs and then reference them by index.
I find it more clean to do it this way:
MainViewModel tab1= ConfigViewModel Tab2 = UserProfileViewModel
in MainViewModel:
private ConfigViewModels _configVM;
public ConfigViewModels ConfigVM { get { return _configVM; } }
private UserProfileViewModel _userProfileVM;
public UserProfileViewModel UserProfileVM { get { return _userProfileVM; } }
public MainViewModel(){
_configVM = new ConfigViewModels();
_userProfileVM = new UserProfileViewModel ();
}
In th XAML file:
I'm not sure I understand the benefit of doing this through an observable collection.