0

我正在使用 Shell,我有 4 个页面,但是在您单击选项卡之前它不会开始尝试加载页面。

是否可以一次加载 Shell 中的所有选项卡?

<FlyoutItem FlyoutDisplayOptions="AsMultipleItems">

    <Tab  Title="Cotizaciones" Icon="quotation.png" Route="QuotationListPage">
        <ShellContent  Title="Cotizaciones" Icon="quotation.png" Route="QuotationListPage" ContentTemplate="{DataTemplate quotation:QuotationListPage}"/>
    </Tab>

    <Tab Title="Pedidos" Icon="order.png" Route="OrderListPage">
        <ShellContent Title="Pedidos" Icon="order.png" Route="OrderListPage" ContentTemplate="{DataTemplate order:OrderListPage}"/>
    </Tab>

    <Tab  Title="Entregas" Icon="delivery.png" Route="DeliveryListPage">
        <ShellContent Title="Entregas" Icon="delivery.png" Route="DeliveryListPage" ContentTemplate="{DataTemplate delivery:DeliveryListPage}"/>
    </Tab>

    <Tab  Title="Solicitudes" Icon="user.png" Route="ClientFormListPage">
        <ShellContent Title="Solicitudes Clientes" Icon="user.png" Route="ClientFormListPage" ContentTemplate="{DataTemplate clientform:ClientFormListPage}"/>
    </Tab>
    
</FlyoutItem>
4

1 回答 1

0

是否可以一次加载 Shell 中的所有选项卡?

现在,它不是。

例如,我使用您提供的代码。这是默认设置,以避免糟糕的启动体验。

此 XAML 创建并显示 QuotationListPage,因为它是子类化 Shell 对象中声明的第一项内容。OrderListPage、DeliveryListPage 和 ClientFormListPage 可以通过底部选项卡导航到,并且这些页面仅在用户导航到它们时创建。这种方法的优点是避免了糟糕的启动体验,因为页面是在响应导航时按需创建的,而不是在应用程序启动时创建的。

于 2020-12-23T02:17:32.360 回答