WPF核心类继承树结构

WPF(Windows Presentation Foundation)的类继承结构非常庞大而复杂,以下是最核心的继承树结构,按照主要功能区域展示:

基础对象层级

复制代码
Object
└── DispatcherObject
    └── DependencyObject
        ├── Freezable
        │   ├── Animatable
        │   │   └── Timeline
        │   │       └── Storyboard
        │   ├── Brush
        │   │   ├── SolidColorBrush
        │   │   ├── GradientBrush
        │   │   │   ├── LinearGradientBrush
        │   │   │   └── RadialGradientBrush
        │   │   └── TileBrush
        │   │       ├── ImageBrush
        │   │       ├── DrawingBrush
        │   │       └── VisualBrush
        │   └── Transform
        │       ├── TransformGroup
        │       ├── RotateTransform
        │       ├── ScaleTransform
        │       ├── SkewTransform
        │       └── TranslateTransform
        └── Visual
            └── UIElement
                └── FrameworkElement
                    └── Control
                        ├── ContentControl
                        │   ├── ButtonBase
                        │   │   ├── Button
                        │   │   ├── RepeatButton
                        │   │   └── ToggleButton
                        │   │       ├── CheckBox
                        │   │       └── RadioButton
                        │   ├── HeaderedContentControl
                        │   │   ├── GroupBox
                        │   │   └── TabItem
                        │   ├── Window
                        │   ├── Label
                        │   └── UserControl
                        ├── ItemsControl
                        │   ├── HeaderedItemsControl
                        │   │   ├── MenuItem
                        │   │   └── TreeViewItem
                        │   ├── Menu
                        │   ├── ListBox
                        │   ├── ComboBox
                        │   └── TabControl
                        ├── TextBoxBase
                        │   ├── TextBox
                        │   └── RichTextBox
                        └── Primitives类
                            ├── ScrollBar
                            ├── StatusBar
                            └── ProgressBar

布局控件继承树

复制代码
FrameworkElement
└── Panel
    ├── Canvas
    ├── DockPanel
    ├── Grid
    ├── StackPanel
    ├── WrapPanel
    └── VirtualizingPanel
        └── VirtualizingStackPanel

数据绑定相关

复制代码
Object
├── BindingBase
│   └── Binding
└── BindingExpression

路由事件系统

复制代码
Object
└── RoutedEvent
    ├── RoutedEventArgs
    └── RoutingStrategy
        ├── Tunnel
        ├── Bubble
        └── Direct

资源系统

复制代码
Object
└── ResourceDictionary

样式系统

复制代码
Object
└── Style
    └── Setter

命令系统

复制代码
Object
└── ICommand
    └── RoutedCommand

主要行为特性

  • DispatcherObject: 提供线程关联和UI调度支持
  • DependencyObject: 支持依赖属性系统
  • Visual: 提供渲染支持
  • UIElement: 提供布局和事件支持
  • FrameworkElement: 提供样式、绑定、资源支持
  • Control: 提供模板和交互支持

这个继承结构是WPF设计的核心基础,几乎所有WPF组件都建立在这个架构之上。理解这个继承树对于有效使用WPF和深入了解其工作原理至关重要。

相关推荐
freesheep72013 小时前
WPF使用PreviewTextInput事件限制用户输入
c#·wpf
c#上位机2 天前
wpf之ControlTemplate
wpf
kyranhan4 天前
WPF,窗口拖动事件与窗口内控件点击事件
wpf
孟婆来包棒棒糖~4 天前
SpringCloude快速入门
分布式·后端·spring cloud·微服务·wpf
Humbunklung5 天前
C# WPF 实现读取文件夹中的PDF并显示其页数
pdf·c#·wpf·npoi·gemini·itext
wangnaisheng5 天前
【WPF】NumericUpDown的用法
wpf
步、步、为营5 天前
.NET 9 RC1 正式发布
.net·wpf
界面开发小八哥7 天前
界面组件DevExpress WPF中文教程:Grid - 如何过滤节点?
.net·wpf·界面控件·devexpress·ui开发
I'mSQL7 天前
C#与WPF使用mvvm简单案例点击按钮触发弹窗
开发语言·c#·wpf
百锦再8 天前
WPF依赖属性深度解析:从原理到高级应用
wpf·依赖·绑定·验证·net·强制