I am using Unity to control Dependency Injection in my Xamarin Forms application. I have a view model class that takes a parent id and a unity injected service as constructor parameters.
public class BrowseViewModel {
public BrowseViewModel(int parentId, IInjectedService injectedService) {
}
}
I have registered the class in the unity container.
unityContainer.registerType<BrowseViewModel>();
I have also registered the service in the unity container.
unityContainer.registerType<IInjectedService, InjectedService>();
My question is, how do I specify the value for parentId when Unity creates an instance of my class? I don't think I should have to specify the injectedService parameter because I have already registered this class with unity and it is a singleton class.