WinUI3 issues with Frame loading and returning

春辉 马 0 Reputation points

I'm having a magical issue with Frame, it's random. My basic code is as follows

But when I load, 99% of the time it loads successfully, and when I return, there is a high probability that there will be no content

First use ItemsRepeater to load the list, its ItemTemplate inside a custom control, and the custom control contains a Frame

<ItemsRepeaterScrollHost HorizontalAlignment="Center">

                <ScrollViewer IsVerticalScrollChainingEnabled="False">
                        ItemTemplate="{StaticResource StaggeredTemplate}"
                        ItemsSource="{Binding Widgets}">
                                RowSpacing="8" />

Below are the loading Page code

        private void ContentFrame_Loading(FrameworkElement sender, object args)
            NavigateHelper.AddFrame(Id, this.ContentFrame,AddFrameType.Replace);
            ContentFrame.Navigate(this.WidgetContent, WidgetSize, new DrillInNavigationTransitionInfo());

Below are the codes that return Page

           var frame = NavigateHelper.GetFrame(WidgetId);
            if (frame!=null&&frame.CanGoBack)

Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
438 questions
{count} votes