MainWindow.xaml.cs 1011 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 wpf_template.Model;
  12. namespace wpf_template
  13. {
  14. /// <summary>
  15. /// Interaction logic for MainWindow.xaml
  16. /// </summary>
  17. ///
  18. public partial class MainWindow : Window
  19. {
  20. public IEnumerable<Product> ProductList { get; set; }
  21. public MainWindow()
  22. {
  23. InitializeComponent();
  24. DataContext = this;
  25. Globals.dataProvider = new LocalDataProvider();
  26. ProductList = Globals.dataProvider.GetProducts();
  27. }
  28. private void ExitButton_Click(object sender, RoutedEventArgs e)
  29. {
  30. Application.Current.Shutdown();
  31. }
  32. }
  33. class Globals
  34. {
  35. public static IDataProvider dataProvider;
  36. }
  37. }