Happy stress free coding

Aug 24, 2012

Note to self–dynamic styles in wpf

Do not do like this:

Something.Background=this.Resources["ButtonBackGray"] as Brush;

…because the style will not update when changed

Do like this:

Something.SetResourceReference(Grid.BackgroundProperty, "ButtonBackGray"); ;

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]



<< Home