SilverLight在后台改变控件的样式

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

Style="{StaticResource btnStyle}" 

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

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

或者:

 

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

 

你可能感兴趣的:(silverlight)