【发布时间】:2012-11-05 10:48:44
【问题描述】:
我在 Bestseller 示例中找到了这个示例
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);
}
所以我试过做
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();
}
但是当我尝试这个时,我得到了
Cirrious.MvvmCross.Exceptions.MvxException:无法加载 ViewModel 对于定位器中的 Core.ViewModels.InstallUnit.GpsViewModel 类型 MvxDefaultVi…
【问题讨论】: