1 using DropDownMenu.ViewModel;
2 using MaterialDesignThemes.Wpf;
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
18 namespace DropDownMenu
19 {
20 /// <summary>
21 /// Interaction logic for MainWindow.xaml
22 /// </summary>
23 public partial class MainWindow : Window
24 {
25 public MainWindow()
26 {
27 InitializeComponent();
28
29 var menuRegister = new List<SubItem>();
30 menuRegister.Add(new SubItem("客户", new UserControlCustomers()));
31 menuRegister.Add(new SubItem("供应商", new UserControlProviders()));
32 menuRegister.Add(new SubItem("员工"));
33 menuRegister.Add(new SubItem("产品"));
34 var item6 = new ItemMenu("登记", menuRegister, PackIconKind.Register);
35
36 var menuSchedule = new List<SubItem>();
37 menuSchedule.Add(new SubItem("服务"));
38 menuSchedule.Add(new SubItem("会议"));
39 var item1 = new ItemMenu("预约", menuSchedule, PackIconKind.Schedule);
40
41 var menuReports = new List<SubItem>();
42 menuReports.Add(new SubItem("客户"));
43 menuReports.Add(new SubItem("供应商"));
44 menuReports.Add(new SubItem("产品"));
45 menuReports.Add(new SubItem("库存"));
46 menuReports.Add(new SubItem("销售额"));
47 var item2 = new ItemMenu("报告", menuReports, PackIconKind.FileReport);
48
49 var menuExpenses = new List<SubItem>();
50 menuExpenses.Add(new SubItem("固定资产"));
51 menuExpenses.Add(new SubItem("流动资金"));
52 var item3 = new ItemMenu("费用", menuExpenses, PackIconKind.ShoppingBasket);
53
54 var menuFinancial = new List<SubItem>();
55 menuFinancial.Add(new SubItem("现金流"));
56 var item4 = new ItemMenu("财务", menuFinancial, PackIconKind.ScaleBalance);
57
58 Menu.Children.Add(new UserControlMenuItem(item6, this));
59 Menu.Children.Add(new UserControlMenuItem(item1, this));
60 Menu.Children.Add(new UserControlMenuItem(item2, this));
61 Menu.Children.Add(new UserControlMenuItem(item3, this));
62 Menu.Children.Add(new UserControlMenuItem(item4, this));
63 }
64
65 internal void SwitchScreen(object sender)
66 {
67 var screen = ((UserControl)sender);
68
69 if (screen != null)
70 {
71 StackPanelMain.Children.Clear();
72 StackPanelMain.Children.Add(screen);
73 }
74 }
75 }
76 }