MainWindow.xaml.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using examPrepare.Pages;
  2. using examPrepare.Windows;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using System.Windows;
  9. using System.Windows.Controls;
  10. using System.Windows.Data;
  11. using System.Windows.Documents;
  12. using System.Windows.Input;
  13. using System.Windows.Media;
  14. using System.Windows.Media.Imaging;
  15. using System.Windows.Navigation;
  16. using System.Windows.Shapes;
  17. namespace examPrepare
  18. {
  19. /// <summary>
  20. /// Interaction logic for MainWindow.xaml
  21. /// </summary>
  22. public partial class MainWindow : Window
  23. {
  24. public MainWindow()
  25. {
  26. InitializeComponent();
  27. workspace.Navigate(new Catalog());
  28. GlobalInfo.setUpProductCountFunc += delegate ()
  29. {
  30. int count = 0;
  31. foreach (var product in GlobalInfo.cart)
  32. {
  33. count += product.Value;
  34. }
  35. products_count.Text = count.ToString();
  36. };
  37. while (new Auth().ShowDialog() != true) ;
  38. }
  39. private void catalog_btn_Click(object sender, RoutedEventArgs e)
  40. {
  41. workspace.Navigate(new Catalog());
  42. }
  43. private void cart_btn_Click(object sender, RoutedEventArgs e)
  44. {
  45. workspace.Navigate(new Cart());
  46. }
  47. }
  48. }