MaterialDesignInXAML / MaterialDesignInXAML/MaterialDesignInXamlToolkit

DialogHost Disappears Question

Open
#1,778 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug evaluation required
Dominant language
C#
Stars
16.3k
Forks
3.5k
Avg merge
1d 22h
Merged PRs (30d)
8

Description

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?

![image](https://user-images.githubusercontent.com/62405845/80522778-f4227580-8941-11ea-8cec-3dddf6bcf4d8.png)

Thoughts?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with MainWindows.xaml and InventoryViewControl.xaml, focusing on the nested DialogHost elements identified as RootDialog and Inventory. Trace the OnEditOwnerDialog call to DialogHost.Show while switching between the Inventory and Billing views. Done should define and verify the intended behavior when returning to Inventory: the owner dialog remains recoverable or navigation is appropriately prevented.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.