You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Idea: Display a styled MessageBox before the main window is created in case of an unrecoverable error (a RPC server cannot be started). I do not want to create a window just to tell the user the the app is going to shutdown now anyway. I think it is useful to be able to show a dialog without any other window from time to time.
var dialog = new CustomDialog() { Title = "Error" }; dialog = dialog.ShowDialogExternally();
in App.OnStartup should allow me to do just that as it creates a new window, but it will result in a
System.ArgumentException: 'Cannot set Owner property to itself.'
Expected behavior
I expect to see a dialog. I do not think another window is actually necessary for this to work. The same is true if a window has been created, but not yet shown. (This results in a different exception, but the reason is the same.)
Environment(please complete the following information):
as this will (as far as I can tell) set the owner of the window in any case. I believe that it should not set the property at all if windowOwner is null.
The text was updated successfully, but these errors were encountered:
Describe the bug
Idea: Display a styled MessageBox before the main window is created in case of an unrecoverable error (a RPC server cannot be started). I do not want to create a window just to tell the user the the app is going to shutdown now anyway. I think it is useful to be able to show a dialog without any other window from time to time.
var dialog = new CustomDialog() { Title = "Error" }; dialog = dialog.ShowDialogExternally();
in App.OnStartup should allow me to do just that as it creates a new window, but it will result in a
System.ArgumentException: 'Cannot set Owner property to itself.'
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I expect to see a dialog. I do not think another window is actually necessary for this to work. The same is true if a window has been created, but not yet shown. (This results in a different exception, but the reason is the same.)
Environment(please complete the following information):
Repo
https://github.com/puchs/MahAppsDialog
Additional context
I think the problem is located in src/MahApps.Metro/Controls/Dialogs/DialogManager.cs, line 597:
private static Window SetupExternalDialogWindow(BaseMetroDialog dialog, [CanBeNull] Window windowOwner = null)
{
var win = CreateExternalWindow();
win.Owner = windowOwner ?? Application.Current?.MainWindow;
...
as this will (as far as I can tell) set the owner of the window in any case. I believe that it should not set the property at all if
windowOwner is null
.The text was updated successfully, but these errors were encountered: