title: How to instantiate a Service with parameters in MVVM Light ViewModelLocator?
body: <p>I have been searching for about 3 hours.
  I need to know how do I instantiate a Service with parameters that are produced by another service in MVVM Light's ViewModelLocator.</p>
  <p>In my ViewModelLocator class I register my View Models and then register services that they use, like this:</p>
  <pre><code>        SimpleIoc.Default.Register&lt;INetworkClient&gt;(() =&gt; new NetworkClient());
          SimpleIoc.Default.Register&lt;IApiClientAuthentication&gt;(() =&gt; new ApiClientAuthentication());
          SimpleIoc.Default.Register&lt;IApiClient&gt;(() =&gt;
          {
              INetworkClient networkClient = ServiceLocator.Current.GetInstance&lt;INetworkClient&gt;();
              return new ApiClient(networkClient, new Uri(&quot;https://someuri.com/&quot;),
                                              authResponse.AdminUserId, authResponse.ApiKey);
          });
  </code></pre>
  <p>The problem is that the &quot;authResponse&quot; that I pass to the ApiClient above is a result produced by calling a method on implementation of IApiClientAuthentication (which I also register with IoC container above). That response is not available when I create the ApiClient above. How should I go about it.</p>
  <p>Please, at least push me in the right direction.</p>