TabViewItem内容和重新加载问题

发布于 2025-02-11 07:53:57 字数 392 浏览 1 评论 0原文

我有一个带有UserControl的TabViewItem。

<TabViewItem>
    <local:ListViewUC x:Name="listView" Chapter="{x:Bind Chapter}"/>
</TabViewItem>

每当我在选项卡之间切换时,选项卡的内容和先前的信息都会丢失。 有没有办法禁用重新加载?

i have a TabViewItem with a UserControl inside it.

<TabViewItem>
    <local:ListViewUC x:Name="listView" Chapter="{x:Bind Chapter}"/>
</TabViewItem>

Each time I switch between tabs, the contents of the tab reload and the previous information is lost.
Is there a way to disable reload?

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

方觉久 2025-02-18 07:53:57

tabviewitem内容和重新加载问题

问题是TabViewItem重新加载原因listViewuc reload动画触发,您可以通过设置code> listview.itemcontainertransitions空的过渡汇总或删除默认值 contentThemetransition

<ListView x:Name="TestListView">
    <ListView.ItemContainerTransitions>
        <TransitionCollection/>
    </ListView.ItemContainerTransitions>
</ListView>

TabViewItem Content and Reloading issue

The problem is that TabViewItem reload cause ListViewUC reload animation triggered, you could disable the animation by setting ListView.ItemContainerTransitions with an empty TransitionCollection or remove default ContentThemeTransition.

<ListView x:Name="TestListView">
    <ListView.ItemContainerTransitions>
        <TransitionCollection/>
    </ListView.ItemContainerTransitions>
</ListView>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文