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
Put them in the Resources collection of one of your elements in XAML:
Then get them in code by using FindResource
var blaBrush = this.FindResource("BlaBrush") as LinearGradientBrush;
See Resources Overview for more information.