You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Rg.Plugins.Popup过时弹窗导航方法的替代方案咨询

解决PopupNavigation过时方法的替代写法

官方已将PopupNavigation的静态PushAsync和PopAsync方法标记为过时,需通过PopupNavigation.Instance获取IPopupNavigation实例来调用对应方法,具体替换如下:

1. PushAsync 方法替换

原过时代码:

PopupNavigation.PushAsync(new myPopupPage());

新写法(需添加await关键字保证异步操作正常执行):

await PopupNavigation.Instance.PushAsync(new myPopupPage());

2. PopAsync 方法替换

原过时代码:

await PopupNavigation.PopAsync(true);

新写法:

await PopupNavigation.Instance.PopAsync(true);

注意:如果调用代码所在方法未标记async,需先为方法添加async修饰符,避免同步阻塞引发异常。

内容的提问来源于stack exchange,提问作者Costas

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.01 08:40:42