MainWindow.xaml.cs 854 B

1234567891011121314151617181920212223242526272829303132333435
  1. using System.Text;
  2. using System.Windows;
  3. using System.Windows.Controls;
  4. using System.Windows.Data;
  5. using System.Windows.Documents;
  6. using System.Windows.Input;
  7. using System.Windows.Media;
  8. using System.Windows.Media.Imaging;
  9. using System.Windows.Navigation;
  10. using System.Windows.Shapes;
  11. using Dapper;
  12. using MySqlConnector;
  13. namespace wpf_connection3
  14. {
  15. public partial class MainWindow : Window
  16. {
  17. public List<Product> productList { get; set; }
  18. private void ExitButton_Click(object sender, RoutedEventArgs e)
  19. {
  20. Application.Current.Shutdown();
  21. }
  22. public MainWindow()
  23. {
  24. InitializeComponent();
  25. DataContext = this;
  26. Globals.dataProvider = new DBDataProvider();
  27. productList = (List<Product>)Globals.dataProvider.getProduct();
  28. }
  29. }
  30. }