## Создание подключения к БД MySQL. Получение данных с сервера. #### MainWindow.xaml.cs ``` namespace mysql_connector2 { public partial class MainWindow : Window { public List productList { get; set; } private void ExitButton_Click(object sender, RoutedEventArgs e) { Application.Current.Shutdown(); } public MainWindow() { InitializeComponent(); DataContext = this; Globals.dataProvider = new DBDataProvider(); productList = (List)Globals.dataProvider.getProduct(); } } } ``` #### MainWindow.xaml ```