使用条件时如何从 TabbedPage 隐藏选项卡(xamarin 表单)

How to hide a tab from a TabbedPage when using a condition (xamarin forms)

我有以下问题,我有一个系统,当进入时有一个 xaml 和 TabbedPage 使用不同的内容页面,例如标签,但是当满足特定条件时,我需要其中一个隐藏用户。

我该怎么做?

干杯

在页面的构造函数中只检查添加子页面的时间。我不知道在 XAML

中是否有简单的方法可以做同样的事情
public class MyPage : TabbedPage
{
  public MyPage() 
  {

    this.Children.Add(new Page1());
    this.Children.Add(new Page2());

    if (some conditional check based on user) 
    {
      this.Children.Add(new Page3());
    }

  }
}