CommunityToolkit / CommunityToolkit/Windows

[SettingsExpander] Unhandled "Unspecified error" exception

Aperta
#616 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
C#
Stelle
1.1k
Fork
166
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### Describe the bug

When using a `SettingsExpander` that is bound to an `ObservableCollection` in a page that is not cached (`NavigationCacheMode="Disabled"`) and this page is repeatedly opened (and old instances of the page have been garbage collected), the app crashes once an item of that `ObservableCollection` is removed.

### Steps to reproduce
Download and run this test project : [Test.zip](https://github.com/user-attachments/files/18602524/Test.zip)

### Expected behavior

No crash.
When adding `NavigationCacheMode="Required"` to `Page2`, the crash is not happening

### Code Platform

- [x] WinAppSDK / WinUI 3

### Windows Build Number

- [x] Windows 11 21H2 (Build 22000)

### App minimum and target SDK version

- [x] Windows 10, version 1809 (Build 17763)

### Visual Studio Version

2022

### Help us help you

No, I'm unable to contribute a solution.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Download and run the linked Test.zip project, then reproduce the crash by repeatedly opening the non-cached page and removing an item from its ObservableCollection. Start by tracing the SettingsExpander binding and page lifecycle around Page2 and NavigationCacheMode. Done means item removal no longer crashes when old page instances have been garbage collected.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
csharp
Ambito
frontend
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.