从MvvmCross 5.1升级Xamarin.Android项目到5.2后,代码抛出错误
MvvmCross 5.2 Xamarin.Android抛出错误 '大会' 找不到
Error CS0246 The type or namespace name 'Assembly' could not be found (are you missing a using directive or an assembly reference?)
public class CustomAndroidPresenter : MvxAndroidViewPresenter
{
public CustomAndroidPresenter(IEnumerable<Assembly> androidViewAssemblies) : base(androidViewAssemblies)
{
}
public override void Show(MvxViewModelRequest request)
{
if (request != null && request.PresentationValues != null)
{
if (request.PresentationValues.ContainsKey("MyCustomFlag"))
{
// Get intent from request and set flags to clear backstack.
var intent = base.CreateIntentForRequest(request);
intent.AddFlags(ActivityFlags.ClearTask | ActivityFlags.ClearTop | ActivityFlags.NewTask);
base.Show(intent);
return;
}
}
base.Show(request);
}
}
添加'使用System.Reflection.Assembly'引发以下错误 错误CS7036'没有给定的参数对应于所要求的形式参数“androidViewAssemblies”“CustomAndroidPresenter.CustomAndroidPresenter(IEnumerable的)”' 错误CS1503 '参数1:无法从'Android.Content.Intent'转换为'MvvmCross.Core.ViewModels.MvxViewModelRequest' –
尝试使用'base.ShowIntent(intent)'并添加'使用System.Reflection'而不是'使用System。 Reflection.Assembly'。 –
@ YorkShen-MSFT它抛出错误\t CS7036 \t'没有给定参数对应所需的形式参数'androidViewAssemblies“CustomAndroidPresenter.CustomAndroidPresenter(IEnumerable的)”' 完整的代码我已经张贴在这里[链接] (https://forums.xamarin.com/discussion/103515/updating-mvvmcross-to-5-2-in-xamarin-android-xamarin-ios) –