在Windows窗体中,我通常创建一个父Windows窗体作为主窗体,然后创建从主窗体继承的窗体.如何在WPF中做同样的事情?

问题描述:

在Windows窗体中,我通常创建一个父Windows窗体作为主窗体,然后创建从主窗体继承的窗体.

In Windows Forms, I usually create a parent Windows Form as a Master Form, then create Forms inherting from thast master form.

How to do the same in WPF?

不,您没有. Windows窗体中没有主窗体的概念.此外,不使用表单之间的父子关系.请,在问您的问题之前,学会讲真话.并准确地说出来.

您可能想使用一些不同的东西,而您却无法解释.这必须是使用您自己的自定义基类而不是System.Windows.WindowWindow继承.这是相当简单的东西.例如,请参见本文:
http://geekswithblogs.net/lbugnion/archive/2007/03/02/107747.aspx [ ^ ].

如果您仍然不太清楚,您可以找到更多信息: http://bit.ly/IGYRWY [ ^ ].

祝你好运,
—SA
No, you don''t. There is no a concept of Master Form in Windows Forms. Also, parent-child relationship between form is not used. Please, before asking your question, learn to tell the truth. And tell it accurately.

You probably want to use something different, something you fail to explain. This must be Window inheritance using your own custom base class instead of System.Windows.Window. This is fairly simple stuff. For example, see this article:
http://geekswithblogs.net/lbugnion/archive/2007/03/02/107747.aspx[^].

If this is still not quite clear to you, you can find a lot more: http://bit.ly/IGYRWY[^].

Good luck,
—SA