惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The GitHub Blog
The GitHub Blog
有赞技术团队
有赞技术团队
Apple Machine Learning Research
Apple Machine Learning Research
V
V2EX
Engineering at Meta
Engineering at Meta
美团技术团队
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园 - 司徒正美
I
InfoQ
S
SegmentFault 最新的问题
博客园 - 叶小钗
N
Netflix TechBlog - Medium
Y
Y Combinator Blog
IT之家
IT之家
博客园 - Franky
大猫的无限游戏
大猫的无限游戏
人人都是产品经理
人人都是产品经理
T
The Blog of Author Tim Ferriss
月光博客
月光博客
The Cloudflare Blog
U
Unit 42
GbyAI
GbyAI
L
LangChain Blog
Microsoft Azure Blog
Microsoft Azure Blog

博客园 - AlexCube

ILSpy --- baml反编译错误解决方案 Privacy Policy 小工具 --- 英文单词查询 Wave Generator 2.0.1 SQL Server Full Text Search WPF TreeView View Model 使用dynamic 类型动态调用方法 Silverlight, WCF, Windows Authentication - AlexCube .Net 程序运行方式 如何查看Load Assembly 错误日志 License 收集 VLAN WPF 开源程序 .Net 中通过Reflection获得List成员类型 - AlexCube - 博客园 SQL Server 获取字符串的长度 SQL Server 查看 SQL 语句执行时间 WPF RichTextBox 控件 WPF Layout 如何获取正确的 AJAX Control Toolkit 客户端控件脚本
用户控件 vs 自定义控件
AlexCube · 2010-03-04 · via 博客园 - AlexCube

Posted on 2010-03-04 17:13  AlexCube  阅读(918)  评论(0)    收藏  举报

WPF有两中控件

UserControl:

  •     由多个控件组合而成;
  •     包含代码文件和XAML 文件;
  •     不能使用模板和样式(Cannot be styled/templated);
  •     继承自UserControl

如RGB颜色选择控件就是一个用户控件

                              usercontrol

CustomControl(扩展已有控件)

  • 给已有控件添加新特性;
  • 包含代码文件和默认样式 Themes/Generic.xaml;
  • 可以使用样式和模板;
  • 可以用于创建控件库

来源:http://www.wpftutorial.net/CustomVsUserControl.html

Smile

刷新页面返回顶部