I know you can access page resources by using the following code:
btn.Style = Resource开发者_Python百科s["ButtonStle"] as Style;
But how do you access an application wide resource?
You can access the application through the static Application.Current property.
btn.Style = Application.Current.Resources["ButtonStyle"] as Style;
精彩评论