WPF Expander Button Styled so it is inside Expander Header

后端 未结 2 494
醉酒成梦
醉酒成梦 2021-02-03 12:36

I am using the Expander control and have styled the header as shown in the picture below:

http://www.hughgrice.com/Expander.jpg

The problem I have i

2条回答
  •  孤独总比滥情好
    2021-02-03 13:15

    You will need to edit the Expander's Template, not the HeaderTemplate. The HeaderTemplate doesn't contain the expand button, just the content inside of it.

    The default control template looks something like this:

    
        
            
                
                
            
        
    
    

    I took out most of the attributes but left in the important stuff. Basically, you will want to add your customizations around the ToggleButton. That is what contains the expand button and the header content.

    If you have Expression Blend, it makes this process much easier because you can simply edit a copy of the original template. Visual Studio doesn't really have this ability yet.

提交回复
热议问题