MaterialDesignInXAML / MaterialDesignInXAML/MaterialDesignInXamlToolkit

Nested dialog not visible after closing and reopening parent dialog

Open
#3,735 0 comments 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

### Bug explanation

When you close a parent dialog which has a nested dialog open, the nested dialog becomes invisible the next time you open the parent dialog, it prevents all input because only the nested dialog `PART_ContentCoverGrid` is visible:

https://github.com/user-attachments/assets/dab526c5-eae5-4ee2-98a3-2b884cadb849

This seems to work fine with `TransitionAssist.DisableTransitions="True"`:

https://github.com/user-attachments/assets/034231da-d54e-48c3-b3d8-89cd2375fa1d

Steps:

* Open `Root` dialog
* `Root` dialog opens `Inner` dialog
* Close `Root` dialog
* Reopen `Root` dialog

```csharp
public RootDialog RootDialog { get; } = new();

public MainWindow()
{
InitializeComponent();

_ = Application.Current.Dispatcher.InvokeAsync(async () =>
{
await Delay();
_ = DialogHost.Show(RootDialog);
await Delay();
RootDialog.OpenInnerDialog();
await Delay();

DialogHost.GetDialogSession(null)!.Close();

await Delay();
_ = DialogHost.Show(RootDialog);
});

static Task Delay() => Task.Delay(2000);
}
```

I'm not sure if this is even desired behavior, I assumed that all nested dialogs would close when parent is closed.
Hope I described the issue clearly, its a little bit hard to explain.

### Version

5.1.0

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 by reproducing the sequence in the issue with DialogHost.Show, a nested dialog, and transitions enabled; compare it with TransitionAssist.DisableTransitions="True". Trace DialogHost and nested-dialog state during parent close and reopen, then verify that the reopened parent no longer leaves only PART_ContentCoverGrid visible or blocks input.

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
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.