在前台,我们可以通过语句

Style="{StaticResource btnStyle}" 

来绑定样式,在后台中对应的语句是:

ButtonTest.Style = App.Current.Resources["btnStyle"as Style;  

或者:

 

ButtonTest.Style = System.Windows.Application.Current.Resources["btnStyle"as Style; 

 

相关文章:

  • 2021-05-29
  • 2022-01-06
  • 2022-12-23
  • 2021-09-22
  • 2022-12-23
  • 2022-12-23
  • 2022-01-30
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-02
  • 2022-01-17
  • 2022-12-23
  • 2021-05-29
相关资源
相似解决方案