title: Xamarin.Froms - Instantiate 2 services in viewmodel constructor
body: <p>Fairly new to xamarin.forms, so sorry if this is a silly question.</p>
  <p>I'm trying to instantiate two custom services in my viewmodels constructor, like this:</p>
  <p>*<em>Updated</em></p>
  <p><em><strong>HerdDetailsViewModel</strong></em></p>
  <pre><code>public class HerdDetailsViewModel : ViewModelBase, INavigationAware
  {
      private Herd herd;
      private readonly IHerdService herdService;
      private readonly IHerdUserInfoService herdUserInfoService;
  
      public Herd Herd { 
              get =&gt; herd;
              set =&gt; SetProperty(ref herd, value);
          }
      private HerdUserInfo herdUserInfo;
      public HerdUserInfo HerdUserInfo
      {
          get =&gt; herdUserInfo;
          set =&gt; SetProperty(ref herdUserInfo, value);
      }
   
     
      public HerdDetailsViewModel(INavigationService navigationService, IHerdService herdService, IHerdUserInfoService herdUserInfoService) 
          : base(navigationService)
      {
          this.herdService = herdService;
          this.herdUserInfoService = herdUserInfoService;
          
      }
  
      public override void OnNavigatedTo(INavigationParameters parameters)
      {
          base.OnNavigatedTo(parameters);
  
          Herd = parameters.GetValue&lt;Herd&gt;(&quot;herd&quot;);
          
      }
  </code></pre>
  <p>INavigationService is a reference to the Prism Library for navigation.</p>
  <p>For some reason, i now cant open a specific contentpage.
  After i've made the instantiation of the <em>HerdUserInfoService</em></p>
  <p><em><strong>HerdService &amp; HerdUserInfoService</strong></em> just returns hard coded objects.</p>
  <p>Please, can someone enlighten me.</p>
  <p>Thanks in advance</p>