MaterialDesignInXAML / MaterialDesignInXAML/MaterialDesignInXamlToolkit
DialogHost Disappears Question
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- C#
- Sterne
- 16.3k
- Forks
- 3.5k
- Ø Merge
- 1 T. 22 Std.
- Gemergte PRs (30 T.)
- 8
Beschreibung
Hi,
I started using DialogHost to popup a dialog to edit some properties of a currently selected item.
However if I switch dialogs while the Edit dialog is displayed, and then return back
the Edit dialog disappears and all I see is the gray parent dialog and no way to recover.
In MainWindows.xaml I have:
Basically the same structure as the MaterialDesign demo, where I have a DrawerHost to popup
the main menu views that you can select from (Home, Inventory, Billing, etc.)
One of the menu items is "Inventory"
In InventoryViewControl.xaml I have another DialogHost so I can popup edit controls for selected items.
In the ViewModel for the InventoryViewControl I have:
private async void OnEditOwnerDialog(object _)
{
// The view associated with this model is defined in InventoryViewControl.xaml !!
var model = new OwnerViewControlModel(SelectedOwnerId);
object result = await MaterialDesignThemes.Wpf.DialogHost.Show(model, "Inventory");
SaveOrCancel answer = (SaveOrCancel)(result ?? SaveOrCancel.None);
switch(answer)
{
In the picture below, showing the RootDialog Drawer menu, the Inventory in the background
and the Owner Information from the OwnerViewControl showing.
If I select "Billing" it switches to Billing, and then when I come back to "Inventory"
all I see is the gray inventory and the OwnerViewControl is not showing and no way to
get it.
Is there an event that I can use to make it pop back up, or would it better to try
to prevent the RootDialog from being able to select a different item?

Thoughts?
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit MainWindows.xaml und InventoryViewControl.xaml und konzentriere dich auf die verschachtelten DialogHost-Elemente, die als RootDialog und Inventory identifiziert wurden. Verfolge den Aufruf OnEditOwnerDialog bis zu DialogHost.Show, während zwischen den Ansichten Inventory und Billing gewechselt wird. Done sollte das erwartete Verhalten bei der Rückkehr zu Inventory definieren und verifizieren: Der Besitzerdialog bleibt wiederherstellbar oder die Navigation wird angemessen verhindert.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- csharp
- Bereich
- desktop
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100