MvvmCross缺失的视图模型参数与链接所有程序集启用



为了减小应用程序的大小,我在Xamarin上启用了'Link all assemblies'选项。不幸的是,当我启动应用程序时,传递简单的视图模型参数不起作用。在应用程序输出中,我可以看到以下警告:

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使其工作。什么好主意吗?

提前感谢!

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

和我的视图模型导航:

ShowViewModel<FirstViewModel>(new {isLaunchedForTheFirstTime = true})
[ImplementPropertyChanged]
public class FirstViewModel : MvxViewModel
{
    //properties
    public void Init(bool isLaunchedForTheFirstTime)
    {
        //handling parameter
    }
}

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

最新更新