我有一个带有弹出控件的弹出窗口。有一个主窗口显示这个弹出窗口。在处理需要时间的查询后,弹出窗口会显示数据。所以当弹出窗口正在处理数据时,如果我最大化了其他窗口,那么弹出窗口也会在其他窗口上显示。
我已经在PopUpWindow.xaml.cs中将MainWindow设置为弹出窗口的所有者:
this.Owner = Application.Current.MainWindow;
我已将弹出窗口的“StaysOpen”属性设置为false,但问题仍然存在。 如何阻止弹出窗口在其他窗口被最大化时显示。
Popup
的属性Visibility
设置为*Collapsed
*。像这样:Visibility="Collapsed"
或者在代码中:MyPopup.Visibility = Visibility.Collapsed;
。 - undefined