[英]Creating another thread to get the current window (System.Windows.Application.Current.MainWindow)
[英]C# : System.Windows.Application.Current.MainWindow doesn't return same value on other PC
在Visual Studio 2010中,我具有使用WPF構建的Mdi應用程序。 調用彈出窗口時,我想用當前的主窗口設置所有者。 因此,我們使用了System.Windows.Application.Current.MainWindow
屬性來設置Owner。
這適用於我所有同事的PC,但不適用於我的PC。 它總是返回彈出窗口本身。 為什么??
您需要訪問此窗口,因此請嘗試使用System.Windows.Window中的Window.GetWindow方法。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.