Sajid
Sajid

Reputation: 320

Windows 8 metro apps assign button style programmatically C#

I am trying to set style to button programmatically in C#, i tried it but not done it, i set style to button in XAML so its working fine. But in C# programmatically m not sure how to do it..

In XAML i did like this

Style="{StaticResource DefaultMusicButtonStyle}"

Upvotes: 0

Views: 1970

Answers (1)

Jeff Brand
Jeff Brand

Reputation: 5633

testButton.Style = Resources["DefaultMusicButtonStyle"] as Style;

Upvotes: 3

Related Questions