I found this example in the Bestseller exmaple
public ICommand ViewDetailCommand
{
get { return new MvxRelayCommand(() => RequestNavigate<BookViewModel>(new { category= CategoryEncoded, book=ISBN })); }
}
public BookViewModel(string category = null, string book = null)
{
category = category ?? string.Empty;
book = book ?? string.Empty;
AsyncFindBook(category, book);
}
So I have tried doing
public IMvxCommand GetGpsCommand
{
get
{
return new MvxRelayCommand<SetupViewModel>(type => RequestNavigate<GpsViewModel>(new {installedMeter = _installedMeter}));
}
}
public GpsViewModel(InstalledMeter installedMeter = null)
{
_installedMeter = installedMeter;
Latitude = 0.0;
Longitude = 0.0;
ButtonStartReading = "Start";
this.GetService<IGpsService>().CoordinatesFoundEvent += CoordinatesFound;
//this.GetService<IGpsService>().StartReading();
}
But when I try this I just get
Cirrious.MvvmCross.Exceptions.MvxException: Failed to load ViewModel for type Core.ViewModels.InstallUnit.GpsViewModel from locator MvxDefaultVi…