如何在XAML中实现可分离控件& WPF
我希望在我的软件中具有可拆卸的控件,用户可以将视图(控件)拖到单独的窗口中。就像 Visual Studio 2010 中的 TabItems 一样。
此时,只要单击菜单点并请求新的数据类型,就会创建特定的视图。视图显示在 HeaderedContenControl 中,该控件具有 ContentPresenter 作为子元素。 我的目标是使单击该控件的标题并将其拖出成为一个单独的窗口成为可能。此外,不应通过单击新菜单点来更改单独的窗口,而是应在主窗口中再次生成新视图。 TabControl 及其 TabItems 似乎是实现此行为的更好控件,但标准 TabItem 是一个非常基本的东西,没有这种功能。
我在网上搜索了解决方案,但还没有找到任何东西。我希望我能在这个网站上找到帮助。
I want to have detachable controls in my software where a user can drag out a view (control) into a seperate window. Like the TabItems in Visual Studio 2010.
At this time the specific views are created whenever a menu point is clicked and a new DataType is requested. The views get displayed in a HeaderedContenControl which has a ContentPresenter as child element.
My goal is to make it possible to click on the header of this control an drag it out to become a seperate window. In addition the seperate window should not be changed by clicking a new menu point, instead the new view should be generated in the mainwindow again.
The TabControl with its TabItems seems to be a better control to realise this behavoir but the standard TabItem is a pretty basic thing without such abilities.
I searched the net for a solution but didn't find anything yet. I hope I can find help on this site.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
此功能通常是各种对接解决方案的一部分。我个人推荐 AvalonDock - 它可以完全完成您所描述的操作,并且是免费的(并且开源)。
如果您想自己编写这样的功能,您最好准备好编写大量代码;)
This feature is usually part of various docking solutions. I personally recommend AvalonDock - it can do exactly what are you describing and is free (and open source).
If you want to write such feature yourself, you better get ready to write significant amount of code ;)
另一种选择是Infragistics 控件。
我们已经在一个相当大的项目中使用过它并且很满意。
但它们并不是免费的。
Another option would be the Infragistics Controls.
We have used it in a rather large project and were satisfied.
They are not free though.