提问人:Bernd Morgeneyer 提问时间:10/31/2023 更新时间:10/31/2023 访问量:35
检查当前是否显示 ContentPage:解决方案对我不起作用
Check if ContentPage is currently shown: Solution not working for me
问:
我使用了与此线程相同的标题,因为那里提供的解决方案对我没有真正用处:
1.) 因为我使用了 Visual Studio 生成的模板,所以 总是 .MainPage = new AppShell();
Application.Current.MainPage
AppShell
2.) 此页面定义为 FlyoutItem,但也被调用。因此,当 已初始化 (但被 中定义的另一个页面隐藏) 时调用,但在 FlyoutMenu 选择后出现此页面时不会调用。GoToAsync
OnAppearing
FlyoutItem
CurrentItem
答:
0赞
FreakyAli
10/31/2023
#1
如果您使用的是 Shell,您所要做的就是获取当前显示的 Shell 页面。
var currentPage = Shell.Current.CurrentPage;
评论