RadWindow.Alert在应用程序或Tab + Alt之间切换时隐藏

时间:2014-05-01 11:13:50

标签: .net wpf winforms mvvm telerik

我有必要创建RadWindow.Alert,当我在应用程序之间切换或按Tab + Alt时,我看到这个radwindow被隐藏。什么是解决方案?

1 个答案:

答案 0 :(得分:0)

var topWindow = Application.Current.Windows.Cast<Window>().FirstOrDefault(win => win.Topmost);

Application.Current.Dispatcher.BeginInvoke(new Action(() => RadWindow.Alert(new DialogParameters
                                                                           {
                                                                               Content = "write your comment",
                                                                               Header = "type header here",
                                                                               DialogStartupLocation = WindowStartupLocation.Manual,
                                                                               Left = targetX,
                                                                               Top = targetY,
                                                                               Owner = topWindow ?? Application.Current.MainWindow
                                                                           })));