本文来自网络,由大胡子制作.版权归原作者所有.如果你有 wpf 的好资料可以联系我 QQ:249872349,Email:BigBeard@126.com
目录
WPF 体系结构 .......................................................................................................................................................... 3
WPF 应用程序管理 .................................................................................................................................................. 5
一、WPF 应用程序由 System.Windows.Application 类进行管理 ................................................................. 5
二、创建 WPF 应用程序 ................................................................................................................................. 5
三、应用程序关闭 ........................................................................................................................................... 6
四、Application 对象的事件 ........................................................................................................................... 7
五、WPF 应用程序生存周期 .......................................................................................................................... 9
WPF 窗体 ................................................................................................................................................................ 10
一、窗体类 ..................................................................................................................................................... 10
1、XAML 文件....................................................................................................................................... 10
2、后台代码文件 ................................................................................................................................... 10
二、窗体的生存周期 ......................................................................................................................................11
1、显示窗体 ............................................................................................................................................11
2、关闭窗体 ........................................................................................................................................... 12
3、窗体的激活 ....................................................................................................................................... 12
4、窗体的生存周期 ............................................................................................................................... 12
三、其他窗体相关的属性、方法、事件 ..................................................................................................... 15
四、定义异形窗体 ......................................................................................................................................... 16
StackPanel、WrapPanel、DockPanel 容器 .......................................................................................................... 19
一、StackPanel ............................................................................................................................................... 19
1、可以使用 Orientation 属性更改堆叠的顺序 ................................................................................... 19
2、设置控件的属性,调整控件的显示................................................................................................ 20
二、WrapPanel ................................................................................................................................................ 20
三、DockPanel ................................................................................................................................................ 21
Grid UniformGrid 容器 ........................................................................................................................................ 22
一、Grid .......................................................................................................................................................... 22
二、使用 GridSplit 分割 ................................................................................................................................ 23
三、UniformGrid ............................................................................................................................................ 25
Canvas、InkCanvas 布局 ....................................................................................................................................... 27
一、Canvas ..................................................................................................................................................... 27
二、InkCanvas ................................................................................................................................................ 27
WPF 对控件其类型的继承方式如下 .................................................................................................................... 29
WPF 控件内容模型 ................................................................................................................................................ 32
一、ContentControl 模型 ............................................................................................................................... 35
二、HeaderedContentControl 模型 ................................................................................................................ 36
三、ItemsControl 模型 ................................................................................................................................... 38
1、使用 ItemSource 属性 ....................................................................................................................... 38
2、使用 Items 属性 ................................................................................................................................ 40
四、HeaderedItemsControl 模型 .................................................................................................................... 42
Panel Decorator TextBlock 内容模型 .................................................................................................................. 44
一、Panel 内容模型 ....................................................................................................................................... 44