En WPF j'ai souvent utilisé une telle construction:"ShowDialog/DialogResult" alternatif dans Silverlight
SomeChildWindow dlg = new SomeChildWindow();
dlg.ShowDialog();
...
//child window is closed either by "this.DialogResult = true;" or just by "Close();"
//and in Parent window after Child window is closed we can use condition based on that
...
if (dlg.DialogResult == true)
{
//do something
}
Mais dans Silverlight cette approche ne fonctionne pas.
Quelle est l'alternative dans Silverlight pour cela? Je veux dire comment il est censé obtenir un retour de la fenêtre enfant dans Silverlight?
Merci, Jeff. Ça marche. Mais lorsque vous déposez "== true" comme vous le suggérez, j'obtiens une erreur: "Impossible de convertir implicitement le type 'bool?' 'bool' Une conversion explicite existe (manque-t-il une distribution?) " – rem
@rem: Totalement oublié que le résultat est nullable. Désolé pour ça. Personnellement, j'utiliserais 'window.DialogResult ?? false', plutôt que 'window.DialogResult == true'. –
OK, merci. +1 – rem