消息框所有权设置

Message Box OwnerShip setting

我是 WPF 新手,我创建了一个聊天应用程序,现在我需要显示像 this but what is my issue is when the user clicks out of my application, application goes to the background but opened popup is open on the foreground like this

这样的消息框

使用的代码是::

 if (string.IsNullOrEmpty(EmailId))
 {
    BusyIndication = Visibility.Hidden;
    CustomMessageBox.Show("Email ID should not be empty", "Email ID", MessageBoxButton.OK);
    LoginView.SignInButton.IsEnabled = true;
 }

我认为我需要设置所有权 属性 但不知道该怎么做。

有什么建议吗??

任你选:

Show(Window owner, string messageBoxText);
Show(Window owner, string messageBoxText, string caption);
Show(Window owner, string messageBoxText, string caption, MessageBoxButton button);
Show(Window owner, string messageBoxText, string caption, MessageBoxButton button, MessageBoxImage icon);
Show(Window owner, string messageBoxText, string caption, MessageBoxButton button, MessageBoxImage icon, MessageBoxResult defaultResult);
Show(Window owner, string messageBoxText, string caption, MessageBoxButton button, MessageBoxImage icon, MessageBoxResult defaultResult, MessageBoxOptions options);