1,PCL中安装MvvmCross
2,在PCL建立ViewModel模型,继承于MvxViewModel
3,在PCL的App.cs中注册
- 如果有Iservice的注册 Mvx.RegisterType<ICalculation, Calculation>();
- 注册模型 Mvx.RegisterSingleton<IMvxAppStart>(new MvxAppStart<AppDataViewModel>());
4,在Droid(android)项目中安装MvvmCross
5,在根下建立 Setup.cs
6,修改应用viewModel模块的Activeity,继承于MvxActivity
public class MainActivity : MvxActivity<AppDataViewModel>
时间: 2024-11-08 21:46:03