Set button background style in wpf

前端 未结 2 1286
花落未央
花落未央 2020-12-17 01:52

i have one button and i set button background style with LinearGradientBrush. everything works fine but when i run button and press click on button then gra

2条回答
  •  一生所求
    2020-12-17 02:24

    This happens because of the buttons default style.

    You need to set a new Style.

    EDIT :

    
    

    If you want to have this style more than once use it as a resource: Putting it to sets you this style for every button in your Window.xaml

    Moving the style to a higher scope like App.xaml applies the style for every button in your application

提交回复
热议问题