btn.Style = Resources["ButtonStle"] as Style;
但是如何访问应用程序的资源?
btn.Style = Application.Current.Resources["ButtonStyle"] as Style;