WPF 内容控件超出其父控件的范围
这是 我昨天问的这个问题(这个问题给了我一个可以覆盖当前控件的内容控件)。我现在有一个内容控件,可以通过绑定(模态类型窗口)覆盖在当前控件上。这效果很好,我对此很满意。一个很棒的功能是如果我能让覆盖层覆盖其父级。
目前,叠加层将进入“我的控制”控制。我想要的是,如果我仍然可以在该控件中定义它(因为这是需要的),但是当它显示时,它可以覆盖整个主要内容区域和/或主窗口。
这可能吗?
谢谢
This is a sort of extension of this question I asked yesterday (the question gave me a contentcontrol that can overlay the current control). I now have a contentcontrol that can be overlayed on the current control via bindings (a modal type window). This works well and I am happy with this. One great feature would be if I could get the overlay to go over its parent.
currently the overlay will go into "My Control" control. What I would like is if I can still define it in that control (as that is were it is needed), but when it is displayed it can cover the whole main content area and / or the main window.
is this even possible?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当然可以,只需将其包装到 Popup 中即可! :) 虽然您可能需要手动拉伸它,但 Popup 是一个可以让您超出父视图边界的控件。
Sure it's possible, just wrap it into a Popup! :) You might have to manually stretch it though, but Popup is the control which will let you go outside the bounds of the parent view.
另一种方法是将 MainContent 托管在网格中,并在 MainContent 之后添加折叠的内容控件。
要显示弹出窗口:将其放入折叠的内容控件中并使其可见。
要隐藏弹出窗口:折叠内容控件并删除弹出窗口。
Another way is to host the MainContent in a grid and add a collapsed content control after the MainContent.
To show the popup: put it in the collapsed content control and make it visible.
To hide the popup: collapse the contentn control and remove the popup.