开发者

Get TreeView's styled expand/collapse icons

I need to render/draw the icons that the default TreeView uses for it's expand/collapse icons. I already found out that you can change them by writing a new style with x:Key="ExpandCollapseToggleStyle", but I have no idea how I could load that style from the currently loaded theme (e.g. Aero, Luna, etc.). I already tried creating a ToggleButton and applying it's Style the StaticResource ExpandCollapseToggleStyle, but the resource can not be found:

<ToggleButton Style="{StaticResource ExpandCollapseToggleStyle}"></ToggleButton>

How can I apply styles defined in the default t开发者_如何转开发heme to controls they are not actually meant for?


it doesn't really work that way.

you have to extract the styles from that specific theme, copy them to your code and then reference them. Look here for how to extract the styles and templates. Martin Liversage's answer number 2 doesn't only work on silverlight assemblies. You can use Reflector (too bad it's commercial now...) to get the styles and themes from wpf dlls too.

btw: the corresponding ddls are named like PresentationFramework.Luna.dll

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜