为什么WPF中没有可视继承? [英] Why isn't there visual inheritance in WPF?

查看:94
本文介绍了为什么WPF中没有可视继承?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Windows窗体中,有时会有一个窗口从另一个窗口继承。但在WPF中,这是不允许的。为什么WPF窗口没有可视继承?

In Windows Forms, it was useful at times to have one window that inherited from another window. But in WPF, this is not allowed. Why is there no visual inheritance for WPF windows?

推荐答案

在WPF中,我们付出了巨大努力将视觉与逻辑分开。因此,有大量的自由度可以让UI看起来像你想要的那样。包括窗户在内的所有控件都是不露面的。您可以通过模板和样式提供自己的外观。提供了默认的视觉样式,使一切看起来像您期望的那样,但您不必使用它。

In WPF, a large effort was made to separate visual from logical. Because of this, there is a LARGE amount of freedom to make the UI look however you want. All of the controls, including windows, are "lookless". You can provide your own look via templates and styles. A default visual style has been provided that makes everything look like you would expect, but you don't have to use it.

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

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