right now I am using MVVM Light to achieve the MVVM Pattern. So in my view I create multiple tabs and bind them to multiple instances of one ViewModel. I achieve this with:
ServiceLocator.Current.GetInstance<ViewModel>(key);
When I do this, every instance of ViewModel is connected to the same one instance of DataService registered in the ViewModelLocator:
SimpleIoc.Default.Register<IDataService, DataService>();
But I want to have for every instance of the Viewmodel also one instance of Dataservice. Why? Because each instance of ViewModel has the same function but requires other data.
How do I create in MVVM Lights ViewModelLocator a new instance of DataService when for a new Instance of ViewModel? Is this possible or isn't that a good approach in the MVVM Pattern and I failed to understand DataService correctly?