Based on MvvmCross, I need to navigate MainViewModel to TestViewModel, here is my code and its not working
MainViewModel:
//Command_SJCJ is a button in MainPage
public IMvxCommand Command_SJCJ
{
get
{
return new MvxCommand(() =>
_navigationService.Navigate<TestViewModel>());
}
}
TestViewModel:
public class TestViewModel:MvxViewModel
{
private IMvxNavigationService _navigationService;
public TestViewModel(IMvxNavigationService navigation)
{
_navigationService = navigation;
}
}
}
TestPage.xaml:
<?xml version="1.0" encoding="utf-8" ?>
<views:MvxWindowsPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:controls="clr-namespace:Esri.ArcGISRuntime.UI.Controls;assembly=Esri.ArcGISRuntime"
xmlns:views="using:MvvmCross.Uwp.Views"
x:Class="nsc.hby.Survey.UWP.Pages.TestPage">
<views:MvxWindowsPage.Content>
<controls:MapView/>
</views:MvxWindowsPage.Content>
</views:MvxWindowsPage>