Can I dynamically switch between styles in WPF?

后端 未结 2 876
情书的邮戳
情书的邮戳 2020-12-21 22:03

Let\'s say I wanted to display a Button and a few RadioButtons. Based on which RadioButton is selected, I want to apply a different st

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-21 22:47

    You can just set the Style in the code behind.

        button.Style = (Style)FindResource("NameOfYourStyle");
    

提交回复
热议问题