Upgrading MvvmCross to 5.2 shows error on CustomAndroidPresenter

前端 未结 1 652
余生分开走
余生分开走 2021-01-23 14:41

After upgrading MvvmCross from 5.1 to 5.2 , my CustomAndroidPresenter.cs is throwing a build error. What is causing this?

CustomAndroidPresenter.cs:

name         


        
相关标签:
1条回答
  • 2021-01-23 15:37

    You need to add a constructor for MvxAndroidViewPresenter(IEnumerable):

    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.ShowIntent(intent);
                    return;
                }
            }
            base.Show(request);
        }
    }
    
    0 讨论(0)
提交回复
热议问题