how to call MvxDialogViewController as a popover

不打扰是莪最后的温柔 提交于 2021-01-29 18:16:37

问题


I am trying to display MxxDialogViewController from a popover and am getting an exception

18.35 Request is null - assuming this is a TabBar type situation where ViewDidLoad is called during construction... patching the request now - but watch out for problems with virtual calls during construction

while calling base.ViewDidLoad()

here is what I did to demonstrate the problem as a small sample:

I took N-23 example and added to the first section a new element with the Tapped command

new StringElement("test Popover", Tapped),

here is Tapped(), as a test I am trying to display the same FirstView in a popover.

    private void Tapped()
    {
        var dvc = new FirstView();
        var nc = new UINavigationController(dvc);
        _ardlViewPopover = new UIPopoverController(nc);

        _ardlViewPopover.PresentFromRect(this.View.Frame, this.View, UIPopoverArrowDirection.Any, true);
    }

Should MvxDialogViewController work inside of a popover controller?

Thank you

Mark


回答1:


The error message is Request is null

Try setting the Request property for the FirstView - e.g. if there are no parameters then use:

var dvc = new FirstView();
dvc.Request = MvxViewModelRequest<FirstViewModel>.GetDefaultRequest();


来源:https://stackoverflow.com/questions/26261543/how-to-call-mvxdialogviewcontroller-as-a-popover

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!