Change shape of WPF button without changing other styles

后端 未结 3 1804
耶瑟儿~
耶瑟儿~ 2021-01-04 23:56

I would like to change the shape of a WPF button from the default round rectangle to another shape (say, an arrow), but I want to keep the rest of the styling -- fill color,

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-05 00:29

    If you want to inherit the default system colours/styles for a Button you can use TemplateBindings within the button Template. For example, if you wanted to create a custom-shaped button that had the same background colour as the system one, you could use the below:

    
    

    The Ellipse will then inherit the background colour from the Button, however it is set.

提交回复
热议问题