Theoretically, I think that I can define Brushes and Colors etc. in an xaml file and assign that to a button.background in c#. But how do I do that? Where do I put my linear
You can access the application resources as
Application.Current.Resources["BlaBrush"] as LinearGradientBrush
Or, you add the resource to the control's resources and access them like Quartermeister wrote.