如何在 XBAP 应用程序中打开模式窗口/对话框?
在 WPF 中,如果我想打开模式/响应窗口,那么我编写如下代码:
Window1 _windowObj1 = new Window1(); _windowObj1.Owner = mainWindowObject; _window1Obj.ShowDialog();
如何在 XBAP 中执行相同操作。我尝试过,但窗口是独立于父页面打开的,因为我无法将其指定为模式窗口的所有者。
如何在 XBAP 应用程序中打开模式窗口/对话框?
In WPF, if i want to open a modal/response window then i write code like
Window1 _windowObj1 = new Window1();
_windowObj1.Owner = mainWindowObject;
_window1Obj.ShowDialog();
How to do the same in XBAP. I tried it, but the window is opened independently from the parent page as i cant assign it as a Owner of modal window.
How to Open modal window/dialog in XBAP Application?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我对 XBAP 应用程序并没有真正的经验,但我相信您应该尝试在装饰层中显示“弹出窗口”。这具有相同的效果(您无法访问应用程序的其余部分),但实际上并没有根据 windows 打开另一个窗口。谷歌搜索“wpf 装饰器对话框”,您应该会得到一些结果。
以下是一些链接:
如何在 WPF 应用程序中为页面创建模式对话框?
http://www.codeproject.com/KB/silverlight/slmodal.aspx
http://www.codeproject.com/KB/WPF/wpfmodaldialog.aspx
I'm not really experienced with XBAP apps, but I believe you should try displaying "popups" in an adorner layer. This has the same effect (you can't access the rest of the application), but doesn't actually open another window according to windows. Google for "wpf adorner dialog" and you should get some results.
Here are some links:
How do I make modal dialog for a Page in my WPF-application?
http://www.codeproject.com/KB/silverlight/slmodal.aspx
http://www.codeproject.com/KB/WPF/wpfmodaldialog.aspx
你实现了WPF的Window吗?如果是这样,它在 XBAP 中将不起作用。请将您的 UserControl 托管到 Windows.Form,然后您可以在 XBAP 应用程序中打开模式窗口/对话框
You did implement Window of WPF? If so, it will not work in XBAP. Please host your UserControl to Windows.Form, then you can open modal window/dialog in XBAP Application