Search code examples
c#xamluwpwinui-3winui

TabViewItem Content and Reloading issue


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


Solution

  • 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>