MaterialDesignInXamlToolkit icon indicating copy to clipboard operation
MaterialDesignInXamlToolkit copied to clipboard

Nested dialog not visible after closing and reopening parent dialog

Open Yoooi0 opened this issue 1 year ago • 0 comments

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
    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

Yoooi0 avatar Nov 29 '24 23:11 Yoooi0