0

我想在 mvvmcross 上使用名为 rg.plugin.popup 的插件创建一个弹出窗口,但不知道如何实现它。我已经在常规 xamarin.form 上尝试过它并且它有效。

这是我试图在 MVVMCross 上导航的内容:

    public IMvxCommand OnFilterLabel
    {
        get
        {
            return new MvxCommand(async() =>
            {
                await Navigation.PushPopupAsync(new FilterAttendPopup());
                MessagingCenter.Subscribe<Attendance>(this, "ReceiveData", (value)=> { });
            });
        }
    }

但我收到错误:“错误 CS0103 当前上下文中不存在名称‘导航’”

非常感谢您的帮助^_^

4

1 回答 1

0

您可以使用“PopupNavigation.Instance”而不是“Navigation”。您必须初始化此导航:

https://github.com/rotorgames/Rg.Plugins.Popup/wiki/Getting-started#initialization

public IMvxCommand OnFilterLabel
    {
        get
        {
            return new MvxCommand(async() =>
            {
                await PopupNavigation.Instance.PushAsync(new FilterAttendPopup());
                MessagingCenter.Subscribe<Attendance>(this, "ReceiveData", (value)=> { });
            });
        }
    }

如果要使用“导航”,则必须使用以下命令添加:

using Rg.Plugins.Popup.Extensions;
于 2019-11-07T15:59:33.240 回答