title: How to navigate through modal pages in Xamarin.Forms using Fresh.MVVM
body: <p>I was trying to push a modal page in my xamarin forms app using MVVM when pressing a button. I already know how to use navigation stacks, but no idea how to do it with content pages as modal pages, I have tried multiple things, especially, calling the PushPageModel method.</p>
  
  <p>This is the last thing I have tried:
  View or Page:</p>
  
  <pre><code>&lt;Label
                  x:Name="forgottenPasswordLabel"
                  Text="Forgot password?"
                  TextColor="LightPink"
                  FontSize="16"
                  FontAttributes="Bold"
  
                  VerticalOptions="Start"
                  HorizontalOptions="End"
                  Margin="25,0,25,25"&gt;
                  &lt;Label.GestureRecognizers&gt;
                      &lt;TapGestureRecognizer Command="{Binding ForgotPasswordCommand}"/&gt;
                  &lt;/Label.GestureRecognizers&gt;
  &lt;/Label&gt;
  </code></pre>
  
  <p>ViewModel class:</p>
  
  <pre><code>public class LogInViewModel : FreshBasePageModel
      {
          public ICommand ForgotPasswordCommand { get; set; }
  
          public LogInViewModel()
          {
          }
  
          public override void Init(object initData)
          {
              ForgotPasswordCommand = new Command (async() =&gt;
              {
                  var newPage = FreshPageModelResolver.ResolvePageModel&lt;ForgottenPasswordViewModel&gt;();
                  await CoreMethods.PushPageModel&lt;ForgottenPasswordViewModel&gt;(null, false, true);
              }); 
          }
      }
  </code></pre>
  
  <p>App.xaml.cs class:</p>
  
  <pre><code>public App()
          {
              InitializeComponent();
  
              MainPage = FreshPageModelResolver.ResolvePageModel&lt;LogInViewModel&gt;();
          }
  </code></pre>
  
  <p>This code gives the following error: "FreshTinyIoC.TinyIoCResolutionException: 'Resolve failed: IFreshNavigationService"</p>
  
  <p>And that is all, if you need more information I will provide it as soon as I see your request, thank you all for your time, hope you have a great day.</p>
  
  <p>Edit: Stack trace requested:</p>
  
  <blockquote>
    <p>at FreshTinyIoC.FreshTinyIoCContainer.ResolveInternal (FreshTinyIoC.FreshTinyIoCContainer+TypeRegistration registration, FreshTinyIoC.NamedParameterOverloads parameters, FreshTinyIoC.ResolveOptions options) [0x000f7] in C:"Here goes the path" 
      at FreshTinyIoC.FreshTinyIoCContainer.Resolve (System.Type resolveType, System.String name) [0x00000] in C:\"Here goes the path"
      at FreshTinyIoC.FreshTinyIoCContainer.Resolve[ResolveType] (System.String name) [0x00000] in C:"Here goes the path"
      at FreshMvvm.FreshTinyIOCBuiltIn.Resolve[ResolveType] (System.String name) [0x00000] in C:"Here goes the path"
      at FreshMvvm.PageModelCoreMethods.PushPageModelWithPage (Xamarin.Forms.Page page, FreshMvvm.FreshBasePageModel pageModel, System.Object data, System.Boolean modal, System.Boolean animate) [0x00177] in C:"Here goes the path"
      at FreshMvvm.PageModelCoreMethods.PushPageModel (FreshMvvm.FreshBasePageModel pageModel, System.Object data, System.Boolean modal, System.Boolean animate) [0x00048] in C:"Here goes the path"
      at FreshMvvm.PageModelCoreMethods.PushPageModel[T] (System.Object data, System.Boolean modal, System.Boolean animate) [0x00040] in C:"Here goes the path" 
      at FirstApp.ViewModels.LogInViewModel.b__5_0 () [0x0003a] in D:\"Here goes the path" </p>
  </blockquote>