silverlight学习笔记。Style的继承(BaseOn)默认样式的问题
2011-04-04 01:35
633 查看
1 支持设置全局样式,也就是所有button的style,这个style里可以设置button的公共样式,比如大小拉,颜色啦,字体拉等等。
2 针对个别的button,可以设置自己的style,但是这个style是基于1中style的
解决方法:
1 设置一个全局带key的style,
<Style x:Key="CustomButton" TargetType="Button">
<!--在这里设置全局的style-->
</Style>
看到这困惑了把,这个带key的style用到全局,一个一个加key?nono
2 设置一个不带key的style,并且这个style继承上边的全局style
<Style TargetType="Button" BaseOn="{CustomButton}">
</Style>
这样,所有的button的style,默认就是来自于CustomButton。
3 针对特殊的style,设置带key的style,并BaseOn="{CustomButton}"
2 针对个别的button,可以设置自己的style,但是这个style是基于1中style的
解决方法:
1 设置一个全局带key的style,
<Style x:Key="CustomButton" TargetType="Button">
<!--在这里设置全局的style-->
</Style>
看到这困惑了把,这个带key的style用到全局,一个一个加key?nono
2 设置一个不带key的style,并且这个style继承上边的全局style
<Style TargetType="Button" BaseOn="{CustomButton}">
</Style>
这样,所有的button的style,默认就是来自于CustomButton。
3 针对特殊的style,设置带key的style,并BaseOn="{CustomButton}"
相关文章推荐
- WPF and Silverlight 学习笔记(十八):WPF样式(Style)与模板(Template)
- WPF and Silverlight 学习笔记(十八):WPF样式(Style)与模板(Template)
- WPF学习笔记(1):样式(Style)与模板(Template)
- Silverlight 2 学习笔记之事件的重复绑定问题
- [Silverlight学习笔记]关于页面刷新的问题
- SilverLight学习笔记--如何解决Button不响应MouseLeftButtonDown与MouseLeftButtonUp事件的问题
- Silverlight之ListBox/Style学习笔记--ListBox版的图片轮换广告
- [Silverlight学习笔记]关于用户注册之后不能直接登录的问题
- SilverLigth学习笔记--控制 Silverlight控件样式(转)
- Silverlight 2 学习笔记之事件的重复绑定问题
- MonoDroid学习笔记(五)—— 更改TextView字体颜色和背景色及Style样式的定义
- React学习笔记:设置行内样式style属性
- C++学习笔记--多重继承的问题
- Silverlight之ListBox/Style学习笔记--ListBox版的图片轮换广告
- 学习笔记:自定义样式(style)与主题(theme)
- vue学习笔记 样式 class style(五)
- 【C#】解决devexpress新建的Form窗体没有继承默认样式的问题
- ArcGIS API for Silverlight 入门学习笔记(一)hello world 补充问题
- React Native 学习笔记(五)-- 样式Style
- [Silverlight学习笔记]实现上传图片功能时遇到的问题