MaterialDesignInXAML / MaterialDesignInXAML/MaterialDesignInXamlToolkit

DialogHost IsLoaded but not exactly

Aperta
#3,804 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

bug evaluation required
Lingua principale
C#
Stelle
16.3k
Fork
3.5k
Merge medio
1g 22h
PR unite (30g)
8

Descrizione

### Bug explanation

I've uploaded a sample project illustrating the issue.

When trying to get a WPF window to open a view using DialogHost on initial startup/show, I noticed that the DialogHost.Show method throws an exception even though the DialogHost instance IsLoaded property was true. I am thinking the DialogHost is loaded but not yet registered in the LoadedInstances HashSet by the time the Window.IsLoaded event triggers.

https://github.com/jbooth88/DialogHostStartupExample

Looks like IsLoaded property is coming from FrameworkElement, so my guess here is that it's not the correct value to identify whether or not the DialogHost is fully initialized. I am not sure of the best way to solve this problem.

### Version

5.2.1

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia riproducendo la sequenza di avvio con il progetto collegato DialogHostStartupExample e ispeziona DialogHost.Show, FrameworkElement.IsLoaded e l’HashSet LoadedInstances. Determina perché Show può essere eseguito prima che la registrazione sia completata, quindi verifica il fix con lo scenario di apertura della finestra/visualizzazione iniziale descritto nell’issue.

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

Valutazione

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

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.