0

我正在尝试使用 mvvcross 开发我的第一个应用程序。我正在关注本教程http://slodge.blogspot.co.uk/2013/04/n0-first-mvvmcross-application-n1-days.html但我不知道为什么不能在我的代码中使用这个命名空间Cirrious.MvvmCross.ExtensionMethods

要添加所有项目的引用,我正在使用 Nuget,Hot Tuna Starter Pack 的版本是 3.0.10

在此页面中,http ://monodeveloper.org/uncategorized/building-cross-platform-mobile-applications-in-visual-studio-using-xamarin-and-azure-mobile-services/ 有一个 mvvmcross 示例,如果我下载了源代码并在 References 文件夹中添加了这个项目正在使用的引用,我可以使用扩展:(

像这样:

var activity = this.GetService<Cirrious.MvvmCross.Droid.Interfaces.IMvxAndroidCurrentTopActivity>().Activity;

问题是什么?也许与 PCL 程序集有关?

提前致谢!

4

1 回答 1

1

在 MvvmCross v3 中,服务解析的this.GetService<T>风格被简单的Mvx.Resolve<T>调用和基于构造函数的依赖注入所取代。

有关这方面的更多信息,请参阅https://github.com/slodge/MvvmCross/wiki/Service-Location-and-Inversion-of-Control

于 2013-08-06T00:15:31.463 回答