【发布时间】:2019-11-06 10:24:27
【问题描述】:
InteractiveWindow 包含“是”和“否”按钮。当前的解决方案是在MainWIndow 上显示InteractiveWindow,而无法访问MainWindow。 InteractiveWindow 也是 Window(不是 UserControl)。如何转换我的对话窗口以使我的InteractiveWindow 位于我的MainWindow 之上并能够访问MainWindow,直到按下两个按钮之一?
internal async Task<bool> Test()
{
// some code
var test= new InteractiveWindow();
test.Owner = this;
test.ShowDialog();
// some other code
return true;
}
其中一个按钮的旧代码:
private void YES_Click(object sender, RoutedEventArgs e)
{
GetWindow(this).DialogResult = true;
this.Close();
}
【问题讨论】: