MvvmCross - 缺少已启用链接所有程序集的viewmodels参数

时间:2015-08-18 08:47:05

标签: c# xamarin mvvmcross

尝试减少应用程序大小,我在我的Xamarin.iOS应用程序上启用了“链接所有程序集”选项。不幸的是,当我启动应用程序时,传递简单的视图模型参数不起作用。在应用程序输出上,我可以看到以下警告:

mvx:Diagnostic: 1.93 Missing parameter for call to ViewModel - missing parameter isLaunchedForTheFirstTime - assuming null - this may fail for value types!

mvx:Error: 1.94 Failed to parse BoolParser parameter isLaunchedForTheFirstTime from string

我不知道将什么添加到LinkerPleaseInclude.cs以使其工作。有什么想法吗?

提前致谢!

编辑: 这是我的preserve.xml文件,其中包含所有引用的程序集:
http://pastebin.com/cEmLDxqn

我的视图模型导航:

ShowViewModel<FirstViewModel>(new {isLaunchedForTheFirstTime = true})

[ImplementPropertyChanged]
public class FirstViewModel : MvxViewModel
{
    //properties
    public void Init(bool isLaunchedForTheFirstTime)
    {
        //handling parameter
    }
}

1 个答案:

答案 0 :(得分:0)

并非所有链接器都足够聪明,无法检测项目运行所需的所有内容,尤其是在您使用DI或反射时。在这些情况下,您可以configure包含它可能错过的程序集/类型或方法。

相关问题