【问题标题】:Unable to set parent for Xceed.Wpf.Toolkit.MessageBox.Show无法为 Xceed.Wpf.Toolkit.MessageBox.Show 设置父级
【发布时间】:2015-09-17 09:43:18
【问题描述】:

在我的项目中使用了Xceed.Wpf.Toolkit

我正在使用 MVVM,我有一个 MainView.xaml,所有其他视图都是 UserControls 我正在尝试从我的UserControl 后面的代码中显示一个消息框,消息对话框父级未设置为它。

当我的viewmodel 需要时,我会调用对话框消息。

UserControl.Xaml.cs

   private void DialogMessageRecieved(DialogMessage dialMessage)
    {
        switch (dialMessage.Caption)
        {

            case "Warning":
                Xceed.Wpf.Toolkit.MessageBox.Show(App.Current.MainWindow, dialMessage.Content, "Warning", dialMessage.Button, dialMessage.Icon);

                //i noticed that if i use native message box it works, 
               //by my app fully is implemented by Xceed

                 MessageBox.Show(App.Current.MainWindow,
                dialMessage.Content, "Warning", dialMessage.Button, dialMessage.Icon);
                    break;

        }
    }

当显示消息框时,用户切换到另一个应用程序并返回消息框隐藏的应用程序,只有在我按下ALT + TAB后才会显示

Tried this Solution

【问题讨论】:

    标签: wpf xaml mvvm messagebox wpftoolkit


    【解决方案1】:

    通过将工具包降级到 Extended.Wpf.Toolkit -Version 2.3.0 解决了问题

    自 v2.4 以来存在问题,对于工具包“MessageBox 所有者未应用”。

    See the issue

    【讨论】:

      猜你喜欢
      • 2011-10-08
      • 2012-12-23
      • 2020-05-20
      • 1970-01-01
      • 2021-11-29
      • 1970-01-01
      • 1970-01-01
      • 2014-11-03
      • 1970-01-01
      相关资源
      最近更新 更多