如何将 MvxDialogViewController 作为弹出框调用 [英] how to call MvxDialogViewController as a popover

查看:46
本文介绍了如何将 MvxDialogViewController 作为弹出框调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从弹出窗口显示 MxxDialogViewController 并且出现异常

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

18.35 请求为空 - 假设这是一个 TabBar 类型的情况,其中 ViewDidLoad 在构造过程中被调用......现在修补请求- 但要注意构建过程中虚拟调用的问题

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

在调用 base.ViewDidLoad() 时

while calling base.ViewDidLoad()

这是我用一个小样本来演示问题的方法:

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

我以 N-23 为例,并使用 Tapped 命令向第一部分添加了一个新元素

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

new StringElement("test Popover", Tapped),

这里是 Tapped(),作为测试,我试图在弹出窗口中显示相同的 FirstView.

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);
    }

MvxDialogViewController 应该在弹出框控制器内工作吗?

Should MvxDialogViewController work inside of a popover controller?

谢谢

标记

推荐答案

错误信息为Request is null

尝试为 FirstView 设置 Request 属性 - 例如如果没有参数则使用:

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();

这篇关于如何将 MvxDialogViewController 作为弹出框调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆