开发者

Concatenate styles in SL 4 / WPF?

开发者 https://www.devze.com 2023-01-06 12:42 出处:网络
How can I use开发者_C百科 several styles on a control? For example, I have a style that defines the size and margins for buttons, and several styles that define different color schemes.I would like to

How can I use开发者_C百科 several styles on a control?

For example, I have a style that defines the size and margins for buttons, and several styles that define different color schemes. I would like to use the sizing style and a colors style on one control.

Any hints are appreciated...

Thanks.


In Silveright you can't combine multiple styles and apply them to a control. The closest that you can natively get is the Style BasedOn property where you can take an existing Style and extend it with additional setters. However there is no simple way to declarively (or even dynamically) combine two or more existing Styles to create a "combined" style.

0

精彩评论

暂无评论...
验证码 换一张
取 消