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
Your xaml would look something like this:
MainWindow.xaml
To assign the value, you need to grab the gradient brush from the resources like this:
MainWindow.xaml.cs
private void myButton_Click(object sender, RoutedEventArgs e)
{
(sender as Button).Background = this.Resources["BrushOne"] as LinearGradientBrush;
}