为什么在WPF中不支持MDI表单? [英] Why MDI form is not supported natively in WPF ?

查看:177
本文介绍了为什么在WPF中不支持MDI表单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我没有在WPF中找到任何选项来制作MDI表单...

为什么它不支持WPF?我为什么要使用任何第三方库呢?

他们是否故意删除了这个功能?

解决方案

因为它很糟糕想法和人们在没有必要的时候滥用它。



它被设计成类似可以一次打开多个文本文件的记事本 。每个编​​辑文档(MdiChild窗口)都应该做同样的事情。



太多的新手使用它就像是它自己的窗口系统每一个 document是一种不同类型的窗口,例如对话框,选项窗口,消息框等等,其中没有任何内容与某些文档编辑器编辑相同类型的文档有关。


解决方案1中解释的要点非常好。



MDI是一个非常天真的设计尝试介绍,如果我没有太多错误,有些版本Word for Windows。然后有一个丑闻,微软被指控使用无法在应用程序级别模拟的非官方API,因此微软打开了这个API。许多天真的用途(包括我自己,我必须承认)被这个机会所吸引,主要是因为当时Windows的可用UI组件数量更加有限。



如果你看一下,如果我们只考虑至少是专业的应用程序,你将找不到任何使用MDI的应用程序。使用MDI将是吓跑用户并面临一些令人不快的开发问题的可靠方法。 MDI的不便不是很明显吗?



我通常建议不同的选择;最简单的,同时又非常健壮的一个是 TabControl ,两者都有WPF和 System.Windows.Forms 。还有许多其他设计。我在过去的答案中讨论了其中一些:

如何在WPF中创建MDI父窗口? [解决方案2 ],

关于在WPF中使用MDI窗口的问题 [ ^ ],

MDIContainer给出错误 [ ^ ],

如何设置最大化的子表单,最小化最后一个子表单 [ ^ ]。



- SA

Hi,
I didnt find any option in WPF to make an MDI form...
Why its not supported in WPF ?? Why should I use any third party libraries to do so ?
Are they purposefully deleted this feature ??

解决方案

Because it was a bad idea and people abuse the crap out it when they don't have to.

It was designed to be something like a "Notepad that can open multiple text files at once". Every "editor document" (MdiChild window) is supposed to do the exact same thing.

Too many noobs are using it like it is it's own windowing system where every "document" is a different type of window, such as a dialog box, options window, message box, and whatever, none of which have anything to do with some "document editor" editing the same kinds of documents.


The points explained in Solution 1 are very good.

MDI was a very naive design attempt introduced, if I am not much mistaken, with some versions of Word for Windows. Then there was a scandal where Microsoft was accused in using unofficial API which cannot be simulated on the application level, so Microsoft opened this API. Many naive uses (including myself, I must admit) was attracted by this opportunity, mostly because the number of available UI components for Windows was much more limited at that time.

If you look a round, you won't find any application using MDI, if we consider only the applications which are at least minimally "professional". Using MDI would be a sure way to scare off the users and face some unpleasant development problem. Aren't the inconveniences of MDI obvious enough?

I usually advise different alternatives; and the simplest and, at the same time, quite a robust one being the TabControl, both with WPF and System.Windows.Forms. There are a number of other designs. I discussed some of them in my past answers:
How to Create MDI Parent Window in WPF? [Solution 2],
Question on using MDI windows in WPF[^],
MDIContainer giving error[^],
How to set child forms maximized, last childform minimized[^].

—SA


这篇关于为什么在WPF中不支持MDI表单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆