如何在 WPF 应用程序中实现 mdi
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4051601/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to implement mdi in a WPF application
提问by Asaf
I really like MDI applications.
我真的很喜欢 MDI 应用程序。
It allows me to move quickly between windows and compare the content of different windows. Furthermore, sometime the content of one window is useful for another, so I can copy and paste. I think it's a great user experience for working mode.
它允许我在窗口之间快速移动并比较不同窗口的内容。此外,有时一个窗口的内容对另一个窗口很有用,所以我可以复制和粘贴。我认为这是一种很好的工作模式用户体验。
Right or wrong practice, I love it.
正确或错误的练习,我喜欢它。
I saw Stack Overflow question MDI applications in WPF, and there they gave the Visual Studio 2010environment as an example. I didn't understand if and how it is possible to implement that environment: like having tabs that can be tear off to independent screen (less important for me) and rearranged side by side with the rest of the tabs.
我在 WPF 中看到 Stack Overflow 问题MDI 应用程序,他们在那里以Visual Studio 2010环境为例。我不明白是否以及如何实现该环境:例如可以将标签撕下到独立屏幕(对我来说不太重要)并与其余标签并排重新排列。
I guess that I am looking for "docking layout system in WPF", googleing this offer third-party components.
我想我正在寻找“WPF 中的停靠布局系统”,在 google 上搜索此提供的第三方组件。
I think I'll start with a "normal" application. It feels like there is no easy out-of-the-box implementation here.
我想我将从一个“正常”的应用程序开始。感觉这里没有简单的开箱即用的实现。
回答by Govert
There are two popular projects on CodePlex that might help you:
CodePlex 上有两个流行的项目可以帮助您:
- AvalonDock- a docking library in the style of Visual Studio, and
- WpfMdiwhich is a classic MDI window manager.
- AvalonDock- Visual Studio 风格的对接库,以及
- WpfMdi这是一个经典的 MDI 窗口管理器。
AvalonDock supports separate tab-sets side-by-side and also tear-off windows like Visual Studio, so it should give you everything you need, though not exactly classical MDI. It is used in SharpDevelop, so you could download that to play around and get an idea of how the docking library can be used.
AvalonDock 支持单独的并排选项卡集,也支持像 Visual Studio 这样的可撕式窗口,因此它应该为您提供所需的一切,尽管不是完全经典的 MDI。它在 SharpDevelop 中使用,因此您可以下载它来玩玩并了解如何使用对接库。
Edit:
编辑:
And I found a third one which looks very snazzy: Chronos WPF.
我发现了第三个看起来很时髦的:Chronos WPF。
回答by Asaf
From some reason, Microsoft decided that MDI is wrong. There is a lot of information about this when searching it in Google.
出于某种原因,微软认为 MDI 是错误的。在谷歌中搜索时,有很多关于此的信息。
I believe that it is wrong to kill something that so many people liked and in forums I visited, some people point to a new Microsoft example that works in MDI to stress the point that it is legit way to build an application.
我相信杀死这么多人喜欢的东西是错误的,在我访问的论坛中,有些人指出了一个在 MDI 中工作的新 Microsoft 示例,以强调它是构建应用程序的合法方式。
I hate swimming against the stream, so I quit as soon as I understood that despite it is possible to create an MDI application with modern Microsoft application such as silverlight, wpf and maybe even windows-phone, microsoft really discorage it and doesn't offer any support (as far as I know).
我讨厌逆流而上,所以当我了解到尽管可以使用现代 Microsoft 应用程序(例如 Silverlight、wpf 甚至可能是 windows-phone)创建 MDI 应用程序时,我立即退出,但微软确实不鼓励它并且不提供任何支持(据我所知)。
Hope it helps to others that wonders what happened to our good old MDI "Father".
希望它对其他想知道我们的好老 MDI“父亲”发生了什么的人有所帮助。
回答by PeteT
I don't think their is a built in way to do this. However you may want to look at buying a set of user controls from someone such as DevExpress, Component One, Infragisitcs, Telerik... I would think most of them will have a similar control to how VS2010 works. I know DevExpress does.
我不认为他们是一种内置的方式来做到这一点。但是,您可能想考虑从 DevExpress、Component One、Infragisitcs、Telerik 等人那里购买一组用户控件……我认为它们中的大多数都具有与 VS2010 的工作方式类似的控件。我知道 DevExpress 可以。