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和深入了解其工作原理至关重要。

相关推荐
.NET修仙日记11 分钟前
.NET WinForms + WPF 综合学习路线:从传统到现代的.NET桌面开发
学习·c#·.net·wpf·.net core·winforms
猫林老师2 小时前
鸿蒙元服务开发:免安装的卡片式服务(Atomic Service)
华为·wpf·harmonyos
mingupup18 小时前
WPF/C#:使用Microsoft Agent Framework框架创建一个带有审批功能的终端Agent
c#·wpf
△曉風殘月〆21 小时前
WPF中的变换(Transform)功能详解
wpf
mingupup21 小时前
为WPF应用增加项目图标
wpf
张人玉1 天前
c#WPF基础知识
开发语言·c#·wpf
yantuguiguziPGJ1 天前
WPF 联合 Web 开发调试流程梳理(基于 Microsoft.Web.WebView2)
前端·microsoft·wpf
Aevget1 天前
DevExpress WPF中文教程:Data Grid - 如何使用虚拟源?(二)
.net·wpf·界面控件·devexpress·ui开发·数据网格
大美B端工场-B端系统美颜师2 天前
工控软件开发选择难?Electron、Qt、WPF 对比
qt·electron·wpf
c#上位机2 天前
MefBootstrapper在Prism引导程序中的使用
c#·wpf·prism