using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace StaticAndDynamicResources
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        LinearGradientBrush _linearGradientBrush = new LinearGradientBrush();
        public MainWindow()
        {
            InitializeComponent();
            _linearGradientBrush.StartPoint = new Point(0, 0);
            _linearGradientBrush.EndPoint = new Point(1, 1);
            _linearGradientBrush.GradientStops.Add(new GradientStop(Colors.Lime, 0.0));
            _linearGradientBrush.GradientStops.Add(new GradientStop(Colors.White, 1.0));
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {

            this.grid.Resources["textBlockBackground"] = _linearGradientBrush;


        }
    }
}
