-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Windows]Repeated navigation page crash #18441
Labels
area-controls-collectionview
CollectionView, CarouselView, IndicatorView
area-navigation
NavigationPage
platform/windows 🪟
s/triaged
Issue has been reviewed
s/verified
Verified / Reproducible Issue ready for Engineering Triage
t/bug
Something isn't working
Milestone
Comments
@drasticactions 3Q ,yes!, Repeated Invoke Clear and Add can also cause crash |
XamlTest
added
s/verified
Verified / Reproducible Issue ready for Engineering Triage
s/triaged
Issue has been reviewed
labels
Nov 9, 2023
Verified this on Visual Studio Enterprise 17.8.0 Preview 7.0(8.0.0-rc.2.9530). Repro on Windows 11 with below Project: |
jsuarezruiz
added
the
area-controls-collectionview
CollectionView, CarouselView, IndicatorView
label
Jun 6, 2024
Duplicate of #22790 |
github-project-automation
bot
moved this from Todo
to Done
in .NET 9 MAUI Performance, App Size, Inner Loop
Nov 18, 2024
Foda
added a commit
that referenced
this issue
Nov 19, 2024
### Description of Change Fixes a long-standing crash when navigating pages: 1. Manually clear the `ContentPresenter.Content` property. When navigating pages it was discovered that the `Content` property of the `ContentPresenter` sometimes was not being detached from the parent `ContentPresenter` (the `ContentPresenter` itself does detach from the Page). A workaround for this was to manually clear the `Content` property. **The actual cause of this bug:** I suspect that something causing the lifecycle tracking to be messed up. I'm still not sure what this is, but for now this will help our customers more than nothing. ## Workaround The following can be used as a workaround. Place it in the `Loaded` event for your `AppShell`: ```csharp private void AppShell_Loaded(object? sender, EventArgs e) { Loaded -= AppShell_Loaded; #if WINDOWS if (Handler != null && Handler.PlatformView is ShellView shellView && shellView.Content is MauiNavigationView nv && nv.Content is Microsoft.UI.Xaml.Controls.Frame frame) { frame.Navigating += (s, e) => { if (frame.Content is Microsoft.UI.Xaml.Controls.Page page) { page.Unloaded += PageUnloaded; void PageUnloaded(object sender, Microsoft.UI.Xaml.RoutedEventArgs e) { page.Unloaded -= PageUnloaded; if (page.Content is Microsoft.UI.Xaml.Controls.ContentPresenter presenter) { presenter.Content = null; } }; } }; } #endif } ``` ### Issues Fixed Fixes #22790 #18441 #22131
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
area-controls-collectionview
CollectionView, CarouselView, IndicatorView
area-navigation
NavigationPage
platform/windows 🪟
s/triaged
Issue has been reviewed
s/verified
Verified / Reproducible Issue ready for Engineering Triage
t/bug
Something isn't working
Description
When there are many page elements, repeatedly navigating the interface can cause a crash
NO exception, Just crash
First report on #18331,Android platform. To prevent misunderstandings, create a new issue for the Windows platform
Steps to Reproduce
下载 https://github.com/BaY1251/MauiDebug.git
打开 /ANR/ANR.sln 编译生成工程,并运行.
点击 Shell, 反复切换Home和Sec界面,约10次后,问题复现
#translate
Download https://github.com/BaY1251/MauiDebug.git
Open /ANR/ANR.sln to compile and generate a project
Running
Click on Shell and repeatedly switch between the Home and Sec interfaces. After about 10 times, the problem reappear
Link to public reproduction project repository
https://github.com/BaY1251/MauiDebug.git
Version with bug
8.0.0-rc.2.9373
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Windows
Affected platform versions
Windows10-22H2 net8.0-windows10.0.19041.0
Did you find any workaround?
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: